[Bug]: GLM (ACP) handoff to git worktree fails every time with "provider event stream closed unexpectedly"; continuation stalls until manual re-prompt #36209
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area#
apps/server
Steps to reproduce#
- T3 Code desktop 0.1.5 on macOS, thread running GLM
glm-5.3-flashvia the ACP registry provider (acpRegistry_glm_agent, modeaccept_edits), in a git project. - Mid-turn, have the agent call
t3_worktree_handoffwith acontinuationPrompt.
Happens on essentially every attempt. Local DB shows 7 of 10 GLM runs that invoked t3_worktree_handoff since 2026-11-09 recorded as failed this way (2 completed, 1 user-interrupted); all 3 attempts today failed:
| Run | Status | Completed (UTC) |
|---|---|---|
run:thread:1c096fca-…:ordinal:2 | failed | 2026-11-13T15:50:29.207Z |
run:thread:a8ba36d6-…:ordinal:2 | failed | 2026-11-13T03:19:31.796Z |
run:thread:84a50c11-…:ordinal:3 | failed | 2026-11-13T01:45:11.832Z |
run:thread:0f94b07e-…:ordinal:1 | failed | 2026-11-11T12:39:55.312Z |
run:thread:9a22bd0b-…:ordinal:1 | failed | 2026-11-10T22:03:34.803Z |
run:thread:4a244cf3-…:ordinal:16 | failed | 2026-11-09T21:31:45.494Z |
run:thread:7acfe52f-…:ordinal:2 | failed | 2026-11-09T21:37:19.880Z |
Expected behavior#
As fixed for Codex in #24545: the handoff turn ends cleanly and the worktree-continuation run starts on its own in the new worktree.
Actual behavior#
The handoff tool call itself succeeds — worktree created, branch bound, success payload returned — but the handoff run is recorded failed with the "Provider error / The provider event stream closed unexpectedly" banner, and the queued continuation never starts on its own. The user must send a new message manually to continue in the worktree; that run then works fine.
Timeline from the 10:50 AM failure today (run:thread:1c096fca-2949-4add-8991-8ee321d47964:ordinal:2):
15:50:27.488Z dynamic_tool t3-code.t3_worktree_handoff starts
input: { baseRef: "upstream/main", branch: "feat/strip-tracking-params",
continuationPrompt: "Implement the adaptation of …" }
15:50:29.198Z tool call completes successfully
output.structuredContent: { worktreePath: "/Users/daniel/.t3/worktrees/zapcooking/feat-strip-tracking-params", … }
15:50:29.185Z worktree-continuation run requested (ordinal 3, status queued)
15:50:29.207Z handoff run (ordinal 2) marked **failed** — "The provider event stream closed
unexpectedly" — 9 ms after the tool result
15:52:26.791Z ordinal 3 finally starts, only after the user manually re-prompts
15:52:59Z+ assistant messages flow; work continues normally in the new worktree
Notes:
- The GLM failure mode looks like the Cursor row of #35825 (handoff run reaches a terminal
failedstate withProviderAdapterEventStreamError: Workspace changed.) combined with the Claude row of #35274's table / #22971 (continuation does not start until the user sends a message). Unlike Grok/Antigravity, the run does not hang forever. - Same root-cause family as #35825 / #35274:
WorktreeMcpService.performHandoffrebinds the thread mid-turn →ProviderSessionManager.detach→failSubscribers("Workspace changed.")→ProviderAdapterEventStreamErroron the still-open run. - Diagnosability nit: on 0.1.5,
~/.t3/userdata/logs/server.trace.ndjsoncontained zero entries mentioningProviderAdapterEventStreamError/ "event stream" / "Workspace changed" for these failures — the only trace was the UI banner. The failed-run payloads instatev2.sqlitealso carry no error cause, which made this report harder to assemble than it should be.
Impact#
Major degradation or frequent failure
Version or commit#
0.1.5 (desktop app and server)
Environment#
macOS (Apple Silicon), T3 Code desktop/server 0.1.5, provider instance acpRegistry_glm_agent (GLM glm-5.3-flash over ACP), turn mode accept_edits, thought_level: max
Logs or stack traces#
No stack trace available: the failure is not present in server.trace.ndjson (see note above). Evidence above is from orchestration_v2_projection_runs / orchestration_v2_projection_turn_items in ~/.t3/userdata/statev2.sqlite plus the UI banner screenshot.
Workaround#
Re-prompt after the "Provider error" banner; the next run starts in the new worktree and behaves normally.
tanstack-source added labelsbug
juliusmarminge closed this
Thanks for the triage. It shares the root-cause family (mid-turn detach →
ProviderAdapterEventStreamError: Workspace changed.), but two things are genuinely different from #35274:1. Different symptom — this is the Claude/Muse row, not the Grok row. #35274's headline failure is the hand-off run never settling: stays
runningforever, thread wedged, messages stuck queued. The GLM run does settle — it's recordedfailed9 ms after the tool result (15:50:29.198Z tool success → 15:50:29.207Z failed terminal), with the "provider event stream closed unexpectedly" banner. No hang, no wedge; a manual message works immediately.2. Uncovered path:
continuationPrompt. Both #35274's repro and #22825's four-provider test matrix callt3_worktree_handoffwith nocontinuationPromptand verify with a manually sent follow-up message. This issue is the agent-initiated auto-continuation case, fromstatev2.sqlite:15:50:29.185Z worktree-continuation run requested (ordinal 3, queued) 15:50:29.207Z handoff run settles as failed 15:52:26.791Z ordinal 3 starts — only after I sent a message manuallySo the queued continuation did not drain even though its blocking run reached a terminal state. That failure mode isn't exercised by #35274 or tested by #22825.
Also: GLM
glm-5.3-flashviaacpRegistry_glm_agent(the ACP registry harness) isn't in any of the provider tables in #35274 or #22825, and this was on released 0.1.5, not a main build.If the consensus is same-root-cause, fine to keep this folded — but it'd be good to confirm #22825 (or its successor) fixes the GLM/ACP hand-off and that the
worktree-continuationrun starts on its own whencontinuationPromptis set. Happy to retest on a build with that merged.
Sign in to join this conversation.
This is the same problem as #35274, so I'm closing it in favour of that one. If it is different, say how and it will be reopened.