[Bug]: Grok thread stays running forever after t3_worktree_handoff; later messages stay queued

未关闭
#35,274 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
typescript
领域
backend, devtools

调研方向

Start in apps/server, especially RunExecutionService.ts around the ingestion-failure handler near line 1734, and trace how a hand-off detach interacts with AcpAdapterV2.interruptTurn and runtimeTransitionPermit. Compare Grok's behavior with the Codex hand-off fix in #24545 and the related approaches in #22971 and #22825. Done means the hand-off run reaches a terminal state and a later message runs in the new worktree.

由索引模型根据 Issue 内容生成。

描述

[!NOTE]
🤖 Claude Opus 5.5 responding on behalf of leonhoulier

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
  1. Fresh T3 home, Grok provider enabled, a git project.
  2. Start a Grok thread and let one turn finish.
  3. In the next turn, ask the agent to call t3_worktree_handoff with no continuationPrompt.
  4. After the tool returns, send another message.
Expected behavior

The hand-off turn ends, as it does for Codex since #24545, and the next message runs in the new worktree.

Actual behavior

The worktree is created and bound to the thread, but the hand-off run never settles. The thread stays running with the hand-off run active, and every later message stays queued. I watched it for 30+ minutes, reproduced on 3 of 3 fresh threads.

The same test with other providers on the same server:

Provider Hand-off turn Next message
Codex completed runs in the worktree
Claude failed: "The provider event stream closed unexpectedly" (#22971) runs in the worktree
Muse failed: same message runs in the worktree
Grok stays running forever stays queued

From the server trace, in this order:

  1. mcp.tool.t3_worktree_handoff succeeds.
  2. ProviderSessionManager.detach runs. Inside it, AcpAdapterV2.interruptTurn exits Interrupted after about 1.6 s while session/close succeeds.
  3. The run's event stream then fails with ProviderAdapterEventStreamError … Workspace changed., logged as "orchestration V2 provider event ingestion failed".
  4. The ingestion-failure handler in RunExecutionService.ts (around line 1734) calls session.interruptTurn again with requestRuntimeRestart: true before writing the failed terminal. That second AcpAdapterV2.interruptTurn span never ends, so the terminal write after it never runs.

My guess, which I haven't verified: the first interrupt is cut off while it holds runtimeTransitionPermit, or its transition fiber is forked into the session scope the detach just closed. The second interrupt then waits on the permit forever. Claude and Muse don't hang because their interrupts return, as a success or a failure.

Impact

Major degradation or frequent failure

Version or commit

main at e9e934bb3d, also 65c0195b46

Environment

macOS (Darwin 25.2, arm64), Node 24.18.1, Grok CLI 1.0.77, model grok-4.7-build-fast, full access. Isolated dev server (vp run dev --home-dir <tmp> --no-seed), threads driven with t3 thread start/send.

Logs or stack traces
WARN orchestration V2 provider event ingestion failed
  RunExecutionIngestError: Failed while ingesting orchestration V2 run execution run:thread:mcp%3A…:ordinal:2.
  [cause]: ProviderAdapterEventStreamError: Failed while streaming grok provider session … events.
    [cause]: Error: Workspace changed.
Workaround

None found. I didn't try Stop.

Related: #22971 (the same hand-off ends failed for Claude), #24545 (the fix for Codex), #22825 (a draft that waits for the turn's terminal on detach).

主要语言
TypeScript
星标
24.8k
派生
6.4k
平均合并
4 小时 16 分钟
30 天内合并 PR
352

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

pingdotgg/t3code 的其他 Issue

查看 pingdotgg/t3code 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。