Skip to content

Claude threads started from a T3 Connect client fail with "provider event stream closed unexpectedly" #15695

Description

@moritzwesemann

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:

  1. Skip the automatic base-branch default once the thread exists on the server.
  2. Send expectedWorktreePath with the update, so the existing guard (Orchestrator.ts:2371-2381) rejects outdated updates.
  3. Reject worktree changes on the server while a run is active, instead of detaching the session.

Steps to reproduce

  1. Run the desktop app on Mac A. Connect a second Mac B to it through T3 Connect.
  2. On Mac B, start a new Claude thread in "New worktree" mode with any prompt.
  3. About 1–2 s later it fails with "The provider event stream closed unexpectedly".
  4. 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)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is broken or behaving incorrectly.via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions