Split out of #15136 as requested.
Environment#
- T3 Code server
0.1.2-nightly.20261021.3473 (macOS arm64, desktop app)
- Claude Code
2.1.306, claudeAgent / claude-opus-5-5, full access
Steps to reproduce#
- In a Claude thread attached to the project root, ask: "can you switch this thread to a worktree off main?"
- The agent calls
t3_worktree_handoff with { branch: "bramley/wip-2026-10-21", baseRef: "main" } (no continuationPrompt).
Expected behavior#
The thread moves into the worktree and the turn ends normally.
Actual behavior#
- The worktree is created and the thread is rebound to it.
- The run ends
failed with "The provider event stream closed unexpectedly. Retry the turn; if it keeps failing, check the provider and server logs."
- The handoff tool item stays
running, so the composer shows "Waiting on background task" (#15993). A later server restart reports it as cancelled background work.
The provider event log shows the handoff tool_use at 12:01:23.395Z, then T3's own outgoing query.close at 12:01:27.436Z, and the run marked failed 2 ms later. So the session is ended by T3's planned detach, not by Claude Code crashing.
Screenshot:
Likely cause#
The thread.metadata.update that changes worktreePath detaches every session on the thread (apps/server/src/orchestration-v2/Orchestrator.ts, detachSessionIds) without settling the active run. For single-thread providers, ProviderSessionManager.detach then releases with manual_shutdown, and failSubscribers hands the running turn a ProviderAdapterEventStreamError.
Related: #15993, #14245, #16000, #22748. Open PRs: #15203, #15989.
🤖 Generated with Claude Code
This matches the planned-detach failure tracked in https://git.cafe/pingdotgg/t3code/issues/15136: the worktree binding succeeds, then the handoff turn fails when T3 closes the Claude session (the failed run follows
query.closeby a few milliseconds in your log). OmittingcontinuationPromptremoves the queued-continuation symptom but leaves the same detach failure. Draft fix https://git.cafe/pingdotgg/t3code/pulls/22825 is pending review. Closing as a duplicate; that does not mean the fix has shipped, so please follow https://git.cafe/pingdotgg/t3code/issues/15136 for the release.