Repository navigation
fix(server): release the previous session when sending to another instance - #23198
Merged
Merged
Conversation
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.
Problem
Sending to a second Claude instance with separate native history left the first instance's session and process alive after the handoff. Reproduced on Linux using the real web client and Claude 2.1.303: B answered while A remained bound and no detach effect was queued.
Change
Use the existing switch plan's release list for immediate sends. Before detaching, probe the old runtime for background work, including Claude's native subagents even when the projected roster is empty. Refuse the send while work remains; after completion, retrying releases A and starts B. Shared sessions retain per-thread checks.
Scope and approval
Fixes #20343
GitCafe: https://git.cafe/pingdotgg/t3code/issues/20343
Triaged bug via the automated issue flow: #20343. This addresses immediate-send session cleanup and preserves running background work. Broader lifecycle guards remain tracked in #16000.
Verification
Proof index, regression proof, current controls.
Visible-render matrix is empty: server-only proof uses regression tests and runtime transcripts. The baseline delayed marker was interrupted by a dev watcher restart; no delayed-write claim relies on it. Desktop and mobile were not separately exercised; no client or wire contract changed. Other providers' native runtimes were not exercised.
Models: Claude Opus 5.5 and GPT-6.1-sol, through the T3 Code Claude Code and Codex harnesses.