Repository navigation
relay#543: host sessions swap in a tmux pane - #571
Merged
barelyworkingcode merged 7 commits intoOct 21, 2026
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…(red) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Owner
Author
|
merge-check: merged. approved, target, contract, evidence, owner, weakening |
This was referenced Oct 21, 2026
Merged
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.
Closes #543
Host Claude sessions on a host with tmux 3.0 or later run their runner as the pane of tmux session
relay-agent-<session id>. A drop-in respawns that pane with Claude's UI on the same conversation; closing the terminal, or quitting Claude, respawns the runner in the same pane. A host without tmux 3.0 runs the runner alone, as before. Delete ends the tmux session.Part of the epic #525. Contract and Amendments 1 and 2 are on the issue.
Non-obvious decisions
respawn-pane -cvalue as a format, so a directory holding#Pwould start the UI elsewhere (Amendment 2, reproduced on the verify stack)./dev/null. macOS awk reads-W versionas a program and blocked on the pane's pty (Amendment 1).-S. TheTMUX_TMPDIRform fell back to/tmponce the test dir was gone and killed the machine's own tmux server.tmux attach -t relay-agent-<id>on the host andhosts[].tmux_path.Notes
-Scleanup finds no socket, because the instance cleanup removes the directory first;killUnderends the stub server then. The comment claims a bit more than the code does.TestHostWithoutTmuxDropInUsesTerminalguards the criterion (runner alone, plain drop-in) but cannot go red if only the version gate is deleted, since the fake tmux 2.9 fails every other call too.session-swap-backnow answers BLOCKED on a loopback host with no tmux, instead of running its plain swap. It adds pane checks and removes none.TestHostPaneQuitClaudeHandsBackcan race the client's raw-mode switch; a start timeout in pane mode does not kill a late runner; a swap back acts on the active pane if the owner splits the window.Cost
#directory, harness cleanup), each one round; plus one journey fix (tmux_pathnot written).Evidence
ok relaye2e/features 232.163s(baseline at 49e2279: ok, 461 tests).devboxverify --stack --phase apion a stack built at 1519ad2: pass=8 fail=0 blocked=0 notrun=2;session-swap-backPASS (host tmux 3.7c; pane pid = runner.json pid before,claude --resumeduring, new runner after, onesession_created),session-detached-hostPASS. Run while the full suite ran alongside.relay drop-inin a desktop Terminal showed Claude's UI inrelay-agent-<id>; closing the window handed back (pane pid = new runner pid, samesession_created); the next message was answered; delete ended the tmux session. A project dir withC#Projectsstarted the UI in the home dir before the fix and in the project dir after.Review: no blocking findings (round 2, default model; 1 minor in notes)
Real-app check: pass on the verify stack at 1519ad2, tmux 3.7c; the '#'-dir drop-in seen in the home dir before, in the project dir after
Journey: session-swap-back extended with the pane leg; PASS on stack r543 at 1519ad2
Harness weakening: none; session-swap-back only adds checks (BLOCKED, not PASS, on a host without tmux)
Main harness vs head: epic/525 harness against a stack built at 1519ad2: pass=8 fail=0 blocked=0 notrun=2
Break-and-restore: swap back made to create a new tmux session; TestHostPaneSwapToTerminalAndBack red on session_created; restored byte for byte (sha1 matched)
🤖 Generated with Claude Code