fix(seat): a missing seat's recycled pane never verifies it, and a slow restore isn't reported back at its shell #3843
All Vouch review confidence checks passed
Residual risk 0.23 = Change Risk (0.57) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.57 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #3843"
general
weight: 0.35
mvschwarz
What a person sees today
1. A seat whose tmux session is gone can read
running/verified.- After a tmux server restart, tmux reuses pane ids. A seat whose session never came back can still hold a binding to
%22, and%22may now belong to another seat.-
rig psthen shows the missing seat as running and verified, while sends to it keep failing.- The sends correctly target the missing session's name, so nothing reaches the wrong seat. But the status misleads, and each identity sweep overwrites the
session_missingthat a failed send recorded.2. A single original-session restore can report
Claude resume failed: pane returned to shell instead of entering Claudeand suggest a fresh launch, while the original conversation then starts in the pane a few seconds later.Why
1. The live-pid path doesn't check the session. In
seat-identity-reconciler.tscomputeVerdict, the dead-pane path checks that the pane belongs to the seat's session (#2248), and the null-pid path treats a session missing from the listing assession_missing. The live-pid path checks neither, so any live pane with the bound id verifies the seat, and the neighbour's PID is recorded as the seat's process. #3471 and #3798 keep absence through unreadable samples "until a matching pane is seen", and a recycled live pane is exactly such a match.2. A shell that hasn't read the launch looks like a shell Claude exited to.
- The launch is typed into a new pane as a staged script. If the pane's shell is still running its startup files, it hasn't read the launch yet, and it holds the terminal with nothing under it.
- That looks the same as a shell Claude exited to, so the two idle-shell samples agree and the resume ends in
retry_fresh.- Reproduced on a throwaway tmux socket (
-L) with the realClaudeCodeAdapter.launchHarness: a pane whose.zshrctakes 6 s gave exactly this message, and the stand-inclaudewas running in the pane right after.The fix (in the existing checks; no new refusal, hold or setting)
seat-identity-reconciler.ts: when this sweep's readable listing lacks the seat's session, the live-pid path reads that session's panes again, as the dead-pane path does.- The seat's own pane listed: it keeps verifying (the listing was stale).
- The session listed without that pane:
tmux_unavailable(unknown).- No session:
session_missing.- A listed session pays for no extra read, and an unreadable listing still goes down the existing probe path.
tmux.ts:sendShellCommandremembers the script it staged per target.stagedLaunchUnread(target)is true only while that script still exists; it removes itself when the shell reads it.claude-code-adapter.tsandclaude-resume.ts: a pane whose shell hasn't read the launch isn't "returned to shell". The resume takes the existing longer wait.- If Claude comes up, it's a normal resume.
- If it doesn't, the existing "launch kept" attention result applies, with the token kept, instead of
retry_fresh.Tests
-
seat-identity-reconciler.test.ts: four runtime and label cases; a missing session recorded by a failed send survives the next sweep; a session that appears after the listing without the bound pane reads unknown.-
rig-ps-server-gone.test.ts:rig psreads the seat stopped withsession_missingin its identity, status and activity, sweep after sweep.-
claude-runtime-adapter.test.ts,claude-resume.test.ts,tmux-shell-command.test.ts: the unread-launch cases.- a stale listing whose pane is still the seat's own keeps verifying;
- the recycled pane under an unreadable listing stays unknown;
- a listed session's live pane verifies with no extra read;
- a shell that read the launch and is back at its prompt still reports the return;
- an ordinary resume is marked resumed.
tsc --noEmitpasses.Not covered here
codex-resume.ts,codex-runtime-adapter.ts). It isn't reproduced or changed here.🤖 Generated with Claude Code
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
Bug Fixes
Resume and readiness checks now distinguish reports from earlier launches from reports belonging to the current launch, reducing false failures. Launches that are still starting or have ambiguous reports remain available for attention.
* Seat status now reflects missing sessions more accurately when pane identifiers are reused, without inheriting another seat’s process information. If tmux status cannot be verified, the seat remains marked as running rather than detached.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->