Repository navigation
Unify Claude and Codex execution with persistent tmux terminals - #51
Merged
Merged
Conversation
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.
Claude and Codex previously had separate execution owners, and server shutdown terminated live tmux sessions. This change gives both providers one
ExecutionManager, makes tmux the default terminal transport, and distinguishes ordinary detach from explicit termination.The shared owner centralizes locks, active Native transport, configuration and lifecycle. Provider policies retain Claude ownership checks, input acknowledgments/watchdog, model and permission switching,
/btwcapture, and Codex launch/resume, capability gating, state polling and rollout adoption. Claude retains direct PTY fallback when tmux is unavailable. Native input, sizing, snapshots, status and kill use the shared owner without frontend changes.Claude reattachment verifies durable session/cwd metadata against the actual pane process start identity and executable, while preserving foreign sidecar protections. Shutdown detaches clients and leaves harnesses reattachable; explicit kill also finds persistent sessions after restart without spawning a process. Ownership and takeover endpoints recognize verified persistent panes, including before focus.
Tmux redraws the output escape stream, so
/btwreceives original pane bytes through a private bounded, sequenced datagram relay. Missing data fails capture rather than persisting partial text; an absent receiver cannot block the harness. Launch environments use a private file consumed before exec rather than command-line environment values.Validation:
git diff --checkpass. Tests use synthetic CLIs and isolated tmux sockets; real provider auth/network smoke tests were not run.Limits: pending ephemeral capture is not recovered across a server crash, detached raw terminal history is not retained, and a crash can leave a private temporary socket directory for OS cleanup. Replacing a managed pane executable requires explicit recovery rather than automatic adoption. See
ARCHITECTURE.mdfor lifecycle details.