补充 #2642:手动中断停滞回合后,Codex thread 未恢复并进入无限重建死循环
- Dominant language
- TypeScript
- Stars
- 2.7k
- Forks
- 401
- Avg merge
- 21h 48m
- Merged PRs (30d)
- 776
Description
**提交人**: 用户0504
**客户端版本**: 0.1.46
---
这是对 #2642 的精细化补充,基于相同环境下另一个 Codex 会话(“运行环境对比”)的完整复现时间线。
## 补充的关键复现细节
已定位该会话损坏的具体时间线:
| 时间 | 事件 |
|---|---|
| 03:39:56 | 会话创建并正常启动(gpt-5.6-luna,新 thread)|
| 03:39–04:04 | 正常运行约 25 分钟 |
| 04:04:22 | 发生一次手动中断:`abort took effect; a newer turn is running — not closing session`(该回合已停滞,stalledGeneration 15)|
| 04:04 之后 | thread 开始异常,持续出现 `turn stall watchdog skipped a suspended slice`(回合挂起)|
| 05:08:54 | 首次出现 `Reconnecting... 2/5` |
| 05:35 起 | 进入死循环:`Reconnecting... 2/5→3/5→4/5→5/5 → reconnect watchdog tripped → terminal error drain timed out; closing session for rebuild → startSession → thread/resume ok(回到同一坏 thread)` 无限重复 |
## 关键观察
1. **根因疑似:手动中断一个已停滞的回合后,该 Codex thread 未恢复健康**。日志明确显示中断的是 stalled generation 15,且 `abort took effect; a newer turn is running — not closing session`。
2. **Cindy 的重建机制会把同一个坏 thread 反复恢复**:`thread/resume ok` 的 threadId 始终相同,重建(generation 递增)未能重置线程状态,导致死循环。
3. **同一环境下新建 Codex 会话可正常回复**(新建 thread 即可),说明是**线程级状态损坏**,而非网络/登录/全局故障。
4. 中断可能不止一次:同日 07:19 再次出现 `manual-abort`,同一会话仍停留在原 thread。
## 建议
- 重建会话时,若原 thread 状态损坏(watchdog 反复 tripped),应考虑**新建 thread 而不是 resume 同一坏 thread**;
- 或在超过 N 次重建仍失败后,将 `thread/resume` 降级为 `thread/start`,避免死循环。
复现环境:Cindy 0.1.44,macOS,Codex 会话(gpt-5.6-luna / providerId openai)。
---
**版本区域**: CN
**OS**: darwin arm64 (25.4.0)
**界面语言**: zh-CN
Contributor guide
Research direction
No file, test, or entry point is named. Start by tracing the logged manual-abort, watchdog, thread/resume, and session-rebuild flow; done means a stalled thread no longer causes repeated rebuilds, with a fallback to a new thread or another bounded recovery path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- ai, desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100