[Bug]: Pi thread dies ("Pi process exited unexpectedly") on resume after idle release or mid-thread model switch
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 77/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- node.js, typescript
- 领域
- backend, observability
调研方向
从 provider-pi/src/server/adapter.ts 中2145和2161行附近的意外退出路径开始。然后检查 rpc.ts 中352–353行附近的代码,了解子进程的stderr是如何记录的。重现恢复或切换模型失败的情况,并检查子进程的退出详情。完成标准是:意外退出时会记录退出码和有用的stderr文本(例如末尾部分),以便诊断原因。
由索引模型根据 Issue 内容生成。
描述
What happened
A pi thread (provider opencode-go, model deepseek-v4.1-flash) fails the next turn instantly (~30–200 ms, before any API call) with Pi process exited unexpectedly. (transport_error) in two cases:
- Resume after idle release. After the thread has idled past the 30-minute idle release (
ProviderSessionManager.ts:57,DEFAULT_IDLE_TIMEOUT_MS), the next turn sent via MCPt3_thread_sendrespawns pi and resumes the session withswitch_session(provider-pi/src/server/adapter.ts:2217-2218). Pi dies within 0.08 s. This happened twice on different threads (session file ~1.48 MB). - Model switch on an existing thread. Switching an active thread from
deepseek-v4-protoopencode-go/deepseek-v4.1-flashin the UI produced amodel_changeevent, and the next turn errored about 0.2 s later.
Counter-example: the same thread, with a smaller session (~566 KB), resumed fine from the UI after about 1 h 49 min idle. This points to resume or switch_session fragility (session size or a model change) rather than idle time alone.
Workaround: a new thread on the same worktree, started on the final model from the beginning, works for hours.
Why the cause is hard to confirm
adapter.ts:2145 and :2161 raise the error, but rpc.ts:352-353 logs only the length of the pi child's stderr, not its content, and the exit code is not logged. Could the adapter log the pi exit code and the stderr text (or its tail) on unexpected exit?
Environment
- T3 Code: provider-pi, macOS
- pi 1.5.0, opencode 1.18.25
- Provider
opencode-go, modeldeepseek-v4.1-flash - Threads started through T3 MCP (
t3_thread_launch/t3_thread_send) in a per-card worktree
Related
#26312 (pi fails before RPC after rollback), #12931 (resume of long pi thread), #21208
- 主要语言
- TypeScript
- 星标
- 24.8k
- 派生
- 6.4k
- 平均合并
- 20 小时 2 分钟
- 30 天内合并 PR
- 164
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pingdotgg/t3code 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
pingdotgg/t3code#31718 · 1 条评论 ·
维护者通常 1 天内回复
-
[Bug]: Redesign tab bars ignore clicks on Linux: hidden chat layers keep window drag regions可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
[Bug]: Opening a file on Windows spawns powershell -EncodedCommand, which AVG and Avast block as malware可能已有人在做 @juliusmarminge 于 2 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 67/100
pingdotgg/t3code#30954 · 1 条评论 ·
维护者通常 1 天内回复
-
needs more info
难度 2/5 1-3 小时 新手友好度 79/100
pingdotgg/t3code#30685 · 1 条评论 ·
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
binding:python bug
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 78/100
coollabsio/orbit#72 ·
维护者通常 1 天内回复
-
Bug
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 1 天内回复
-
bug needs-triage potential-regression
难度 2/5 1-3 小时 新手友好度 78/100
aws/aws-sdk-js-v3#8408 ·
维护者通常 1 天内回复