Skip to content

fix(server): release the previous session when sending to another instance - #23198

Merged
juliusmarminge merged 9 commits into
mainfrom
fix/issue-20343
Nov 3, 2026
Merged

juliusmarminge merged 9 commits into
mainfrom
fix/issue-20343

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

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

  • Regression failed before implementation: expected only B's session after handoff, received A and B. The final regression also observes actual runtime scope closure; dropping only the detach effect makes that assertion fail.
  • After merging main at ed9b7ca9c5, the provider-switch integration and switch-service suites passed 41/41 on b94200d73c. Independent reviews also passed the focused suites; both returned MERGE and proof audit returned SUFFICIENT.
  • Runtime captures are from ccbaab5a84; merging main changed no fix files. The PR diff remains the two reviewed files.
  • Scoped server typecheck passed; targeted formatting and lint passed with one preexisting unused-variable warning.
  • Real web/server/Claude verification: a send to B is refused while A's native background task runs, preserving A and the unsent message. A completes its marker; retry produces B's answer, a successful detach effect, and A's process exit.
Evidence Before After
Server lifecycle; Linux, real Vite client 1280×800, Node 24.21.0, Claude 2.1.303 b5a226e49c runtime ccbaab5a84 runtime

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.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fix PR opened by an issue lead; enters the PR loop pr:ready Every gate passed; waits for Julius's land label size:M 30-99 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Sending to another Claude instance leaves the old Claude process running unseen

2 participants