[Bug] 会话假死后新消息不显示也不派发,重启后积压消息被自动补发调用 API(v0.16.5 Windows)
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 22
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
提交前确认 · Pre-submission checklist
- 我已搜索过现有 issue,确认这不是重复 / I searched existing issues and confirmed this isn't a duplicate.
- 我已阅读 CONTRIBUTING.md / I've read CONTRIBUTING.md.
问题类别 · Category
UI / 界面体验 · UI / UX
涉及的 Agent 框架 · Agent framework
ZCode Agent(自研)
严重程度 · Severity
阻塞使用 · Blocking (无法使用核心功能 / core function unusable)
复现频率 · Reproducibility
必现 · Always
问题描述 · Description
Windows 桌面客户端 v0.16.5(GLM-5.3 / bigmodel coding plan OAuth,交互模式 zcodeInteractionBehavior=queue,已连接 5 个 MCP 服务器且均正常,已排查与 MCP 无关)。
一个长任务(连续思考 10 分钟以上)结束后尝试暂停/回退对话,回退被网关拒绝后会话进入"假死":UI 不显示新消息、后端也不派发(rollout 不再有新的 model_io 记录,仅剩每 20 秒一次的 workspace_state.built)。此时发送的消息实际已写入会话存储但界面不可见;退出并重新进入 ZCode 后消息才显示,并立即被自动派发调用模型 API(涉及计费,用户无感知、无法取消)。
可能与 #276(大会话消息被吞、重启后才显示,状态已完成)同源——但本机 v0.16.5 仍可复现,且本报告还包含回退失败导致会话假死、重启后自动补发调用 API 涉及计费等问题。
复现步骤 · Steps to reproduce
- 使用一个长任务(连续思考 10 分钟以上)的会话
- 任务结束后尝试暂停/回退对话(日志 02:12–02:13 连续 4 次 gateway_error: conversation rewind unavailable)
- 会话假死:之后在该会话发送任何消息,UI 第一时间不显示
- 退出并重新进入 ZCode
- 消息此时才显示,且立即自动派发调用 API(日志:02:34:26 应用启动完成 → 02:34:30 即出现该会话的 model request 并开始调用工具)
期望表现 · Expected behavior
- 回退失败时给出明确错误提示,而不是让会话静默假死;
- 消息发送后 UI 应立即显示;若暂时无法派发应有可见的排队/失败提示,而不是静默积压到下次重启时自动补发。
实际表现 · Actual behavior
会话假死后:消息 UI 不显示、不派发;重启后消息才出现并立即自动调用 API。伴随日志错误:session.model_selection.persist_failed: FOREIGN KEY constraint failed;zcode_protocol.v4.gateway_error: Session not found (scope: v4.hydrate)。
ZCode 版本 · ZCode version
0.16.5
设备 / 系统 / 浏览器 · Device / OS / Browser
Windows 10 桌面客户端 (10.0.22631 x64)
截图 / 录屏 / 日志 · Screenshots / Recordings / Logs
日志位于 ~/.zcode/cli/log/zcode-2026-09-03.jsonl,关键记录(本地时间):
- 02:12–02:13 四次 zcode_protocol.v4.gateway_error: conversation rewind unavailable for msg_mtkdoq69_... (scope: v4.command.execute)
- 02:13:13 session.model_selection.persist_failed: FOREIGN KEY constraint failed
- 02:13:13 zcode_protocol.v4.gateway_error: Session not found: sess_... (scope: v4.hydrate)
- 02:34:26 应用启动完成后 4 秒内即自动派发积压消息(model.request.completed → tool.call.started)
可按需提供完整日志与会话 rollout 文件。
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing ~/.zcode/cli/log/zcode-2026-09-03.jsonl and the available session rollout files, then reproduce the failed rewind and restart sequence described in the issue. Trace the gateway_error, foreign-key failure, and queued message handling; done means rewind failure is visible, sent messages appear immediately, and pending messages are not dispatched to the API without user awareness.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, backend, desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100