Skip to content

Unify Claude and Codex execution with persistent tmux terminals - #51

Merged
Comradery64 merged 3 commits into
mainfrom
feat/unified-execution-manager
Oct 31, 2026
Merged

Comradery64 merged 3 commits into
mainfrom
feat/unified-execution-manager

Conversation

@Comradery64

Copy link
Copy Markdown
Owner

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, /btw capture, 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 /btw receives 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:

  • Full Python suite with temporary HOME/Claude/XDG directories: 784 passed, 2 skipped, 78% coverage. The initial default-home run was interrupted after 611 passes because existing refresh tests scan configured home directories; it had no failures.
  • Focused provider/server behavior: 84 passed, 1 skipped, including restart, kill, adoption, ownership/takeover, deleted cwd, raw capture, relay replacement and fallback.
  • Ruff check, changed-file format check, and git diff --check pass. 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.md for lifecycle details.

@Comradery64
Comradery64 merged commit 2565c4b into main Oct 31, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant