What happened
When I start a new Claude thread from my second Mac (connected to my main Mac through T3 Connect), it fails right away with "The provider event stream closed unexpectedly". Claude never answers. The same thread started directly on the main Mac works. Codex threads started from the second Mac keep running.
Diagnosis
About a second after the thread launches, the remote client sends an automatic thread.metadata.update with branch: "main", worktreePath: null. At that moment the server has just prepared the thread's worktree. The server reads the update as "Workspace changed." and detaches the provider session, which kills the Claude turn that just started.
- Client: the effect in
apps/web/src/components/BranchToolbarBranchSelector.tsx:509-525 fills in the worktree base branch while the thread has no branch yet. Once the thread exists on the server, setThreadBranch (:167-191) sends this automatic value to the server too, and without expectedWorktreePath. A launched thread has no branch for about 1.4 s while its worktree is prepared. Over T3 Connect the client seems to hit that window; from the host app it never sent this update.
- Server:
apps/server/src/orchestration-v2/Orchestrator.ts:3210-3215 detaches all provider sessions when worktreePath changes, even while a run is starting. For Claude this ends the run with the generic stream error. Codex sessions survive the detach.
Possible fixes:
- Skip the automatic base-branch default once the thread exists on the server.
- Send
expectedWorktreePath with the update, so the existing guard (Orchestrator.ts:2371-2381) rejects outdated updates.
- Reject worktree changes on the server while a run is active, instead of detaching the session.
Steps to reproduce
- Run the desktop app on Mac A. Connect a second Mac B to it through T3 Connect.
- On Mac B, start a new Claude thread in "New worktree" mode with any prompt.
- About 1–2 s later it fails with "The provider event stream closed unexpectedly".
- The same prompt started on Mac A works.
Version
0.0.46-nightly.20261004.2648 (5a96895). The same code is on main (4ee6bfd).
Environment
macOS 27.0.1 arm64, Node v24.15.0, Claude Code 2.1.289, desktop app on both Macs
Evidence
# One failed launch from Mac B, 2026-10-04 UTC (paths redacted)
15:38:41.296 thread.created branch=null worktreePath=null
15:38:42.666 thread.metadata-updated branch=t3code/134b77b4 worktreePath=<worktrees>/t3code-134b77b4 (server: worktree ready)
15:38:43.043 thread.metadata.update sent by the Mac B client
15:38:43.051 thread.metadata-updated branch=main worktreePath=null
15:38:43.051 provider-session.detached reason="Workspace changed."
15:38:43.956 run failed: "The provider event stream closed unexpectedly. ..."
# Same day: 8 launches from Mac B got this detach. All 5 Claude runs failed; the 3 Codex runs survived (1 ended as interrupted).
Related issues
#15135 has the same error message, but it is caused by archiving a thread. This issue is caused by the automatic branch update after launch.
Fix applied or workaround
Nothing changed on the machine. Workarounds: send the message again in the failed thread, use Local mode on the remote client, or start the thread on the host.
Filed by
Claude Code 2.1.289 (claude-opus-5-5)
What happened
When I start a new Claude thread from my second Mac (connected to my main Mac through T3 Connect), it fails right away with "The provider event stream closed unexpectedly". Claude never answers. The same thread started directly on the main Mac works. Codex threads started from the second Mac keep running.
Diagnosis
About a second after the thread launches, the remote client sends an automatic
thread.metadata.updatewithbranch: "main", worktreePath: null. At that moment the server has just prepared the thread's worktree. The server reads the update as "Workspace changed." and detaches the provider session, which kills the Claude turn that just started.apps/web/src/components/BranchToolbarBranchSelector.tsx:509-525fills in the worktree base branch while the thread has no branch yet. Once the thread exists on the server,setThreadBranch(:167-191) sends this automatic value to the server too, and withoutexpectedWorktreePath. A launched thread has no branch for about 1.4 s while its worktree is prepared. Over T3 Connect the client seems to hit that window; from the host app it never sent this update.apps/server/src/orchestration-v2/Orchestrator.ts:3210-3215detaches all provider sessions whenworktreePathchanges, even while a run is starting. For Claude this ends the run with the generic stream error. Codex sessions survive the detach.Possible fixes:
expectedWorktreePathwith the update, so the existing guard (Orchestrator.ts:2371-2381) rejects outdated updates.Steps to reproduce
Version
0.0.46-nightly.20261004.2648 (5a96895). The same code is on
main(4ee6bfd).Environment
macOS 27.0.1 arm64, Node v24.15.0, Claude Code 2.1.289, desktop app on both Macs
Evidence
Related issues
#15135 has the same error message, but it is caused by archiving a thread. This issue is caused by the automatic branch update after launch.
Fix applied or workaround
Nothing changed on the machine. Workarounds: send the message again in the failed thread, use Local mode on the remote client, or start the thread on the host.
Filed by
Claude Code 2.1.289 (claude-opus-5-5)