模型对话生成阶段静默挂起且模型列表刷新子进程反复超时
- Dominant language
- TypeScript
- Stars
- 2.7k
- Forks
- 395
- Avg merge
- 21h 48m
- Merged PRs (30d)
- 776
Description
**提交人**: 用户0504
**客户端版本**: 0.1.69
---
## 现象
模型对话在使用部分模型时反复出现"生成阶段静默挂起":turn 一直显示 running、最后活动时间不再更新,但既无报错也无任何输出(无 thinking / tool_use / assistant 消息)。同一现象在多天、多个不同会话中稳定复现,用户停掉当前 turn 并重发消息可临时恢复,之后仍会再次卡住。
## 复现步骤
1. 在任意会话中发送一条需要模型生成回复的消息(含工具调用场景时更容易触发);
2. 工具执行正常且很快返回结果(如读文件、运行脚本约几秒);
3. 模型拿到工具结果后,在"生成下一步"阶段长时间无输出(数分钟),无错误信息;
4. 用户停掉该 turn 并重发,能重新开始,但之后会再次出现相同卡顿。
## 期望行为
模型生成阶段应持续产出或明确报错;不应无限期静默挂起。
## 实际行为
生成阶段静默挂起:turn 状态为 running,无任何输出,需人工停轮重发才能恢复。
## 复现频率
高。连续多天、多个会话(含 CLI 类会话与图片编辑类会话)均出现;一天内多次复现,间隔约数分钟。
## 已尝试
1. 停掉挂起 turn 后重发消息:可临时恢复,之后仍复发;
2. 重启应用:短暂改善,但模型列表刷新问题依旧按固定频率复发;
3. 排查自装第三方进程:经确认与第三方网关无关,问题位于应用自身的模型接入链路。
## 相关日志
客户端日志持续出现以下错误(高频、周期约 1 分钟):
```
ERROR codex_models_manager::manager: failed to refresh available models: timeout waiting for child process to exit
proxy: client disconnected mid-response — aborting upstream request (GET /backend-api/codex/models)
```
疑似模型列表刷新子进程超时后未被清理(未 kill、未退避),与对话生成挂起高度相关。
## 建议
1. 对模型列表刷新子进程增加超时清理与退避重试;
2. 排查模型接入服务偶发 429 / 请求不回包的问题。
---
**版本区域**: CN
**OS**: darwin arm64 (25.4.0)
**Harness**: Codex
**Model ID**: ` deepseek-v4-flash `
**界面语言**: zh-CN
Contributor guide
Research direction
Start by tracing codex_models_manager::manager and the GET /backend-api/codex/models refresh path. Reproduce the periodic child-process timeout while watching the client logs, then compare it with a conversation that hangs after tool results. Done means the refresh failure is cleaned up or retried safely and model generation no longer remains silently running without output or an error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100