Skip to content

[Bug]: Claude run fails with "provider event stream closed unexpectedly" after t3_worktree_handoff (still on 0.1.2-nightly.20261021.3473) #22863

Closed

Description

@bramley-jetcharge

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

  1. In a Claude thread attached to the project root, ask: "can you switch this thread to a worktree off main?"
  2. 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 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:

Image

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

Activity

  1. juliusmarminge commented on Oct 21, 2026

    @juliusmarminge
    Member

    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.close by a few milliseconds in your log). Omitting continuationPrompt removes 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.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions