Repository navigation
feat(host): guard codex resume against an active session - #219
Merged
Merged
Conversation
Codex locks a thread for a session's whole life, so resuming one that is open in another terminal fails with "already has an active writer" and exits at once. `zedra <slug> <args>` runs an agent's own CLI wrapper through `AgentActor::run_wrapped`; codex is the only implementation. It probes the lock, offers kill / fork / cancel, then execs the real CLI. `resume_launch_command` routes through the wrapper, so the app hits the prompt instead of a dead terminal. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQXVaJtBFwALs97XDrh53W
tanlethanh
force-pushed
the
feat/codex-resume-guard
branch
from
August 26, 2026 17:43
05d3b19 to
a78518c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
already has an active writerand exited immediately; codex holds an exclusive writer lock per thread for the session's whole life and has no force flag.zedra <slug> <args>now dispatches to an agent's own CLI wrapper viaAgentActor::run_wrapped(defaultNone); codex is the only implementation, since "already running" means something different per agent.zedra codex resumeprobes the lock first and offers kill / fork / cancel, thenexecs the real CLI. Everything else forwards unchanged.resume_launch_commandroutes through the wrapper, so the app shows the prompt instead of a dead terminal.Notes
y(default) sends SIGTERM, polls the lock for 3s, escalates to SIGKILL.frewritesresumetofork, dropping--include-non-interactive, whichForkCommanddoes not accept.agents.overrides.codex.resume_cmdkeeps the guard by keeping thezedra codexprefix.🤖 Generated with Claude Code
https://claude.ai/code/session_01VQXVaJtBFwALs97XDrh53W