zai-org / zai-org/feedback

[Bug] [3.10.1 Windows] 打开历史任务后 UI 无响应:后端 session.resumed 成功但界面收不到任何事件流,无法发送消息/切换模型

Open
#426 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority: P2 status: 待评估 type: Bug
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

稳定性 / 崩溃 · Stability / Crash

涉及的 Agent 框架 · Agent framework

ZCode Agent(自研)

严重程度 · Severity

阻塞使用 · Blocking (无法使用核心功能 / core function unusable)

复现频率 · Reproducibility

必现 · Always

问题描述 · Description

环境

  • 版本:ZCode 桌面版 3.10.1.6272(Windows),内置 CLI 组件 0.16.5
  • 系统:Windows 11 10.0.26200 x64
  • 首次出现:2026-08-29(安装当天),2026-08-30 全天持续复现

症状

  1. 在项目任务列表中点开任意历史任务后,输入框发出的消息无任何反应,切换模型/思考强度控件点不动。
  2. 完全退出客户端重新打开后,能看到之前"发出失败"的消息实际已被后端接收并正常生成了回复。
  3. 新建任务一切正常,仅"打开历史任务"这条路必现卡死。
  4. 重启电脑、结束全部 ZCode.exe 进程、删除 %APPDATA%\ZCode\session 缓存均无法解决。

日志证据(%USERPROFILE%.zcode\cli\log\zcode-2026-08-30.jsonl 与 .zcode\v2\logs\2026-08-30.log)

点开任务瞬间,UI 侧触发两个持久化/水合错误:

session.model_selection.persist_failed  error: "FOREIGN KEY constraint failed"  (modelId=GLM-5.3-Flash, thoughtLevel=max)
zcode_protocol.v4.gateway_error  "Session not found: sess_3afaf218-…"  scope: "v4.hydrate"

(该会话在 db.sqlite 中存在,integrity_check/foreign_key_check 均通过;报 Session not found 的部分会话 ID 甚至从未落库,疑似 UI 前端持有了过期的会话列表)

但后端实际已成功恢复会话并更新模型(时间上紧随其后):

06:57:19.931 session.resumed                     (sess_df9cb251…)
06:57:22-25 session.reasoning_effort.updated ×4  session.model.updated
06:58:05 zcode_protocol.workspace_state.built

界面却始终无响应 —— 后端→UI 方向的事件流未到达渲染层。

另有一次更严重的底层错误(会话进行中数据库连接失效):

06:17:46 turn.failed  cause: "database is not open" (ERR_INVALID_STATE)  (turnNumber=49, turnPhase=processing_input)
zcode_protocol.snapshot.{todos,target,goal_verification_entries}_read_failed  "database is not open"

建议排查方向

  • v4.hydrate 的会话注册/查找时序(UI 请求 hydrate 时会话实例尚未就绪即返回 Session not found,且无重试)
  • session.model_selection 持久化在 session 行落库前执行导致 FOREIGN KEY 失败
  • 渲染层与 agent 运行时之间的事件订阅建立失败后无重连机制

数据情况:会话数据无丢失(db.sqlite 完整性检查通过,239 条消息可读),问题仅在 UI 层。

复现步骤 · Steps to reproduce
  1. 打开 ZCode,进入一个有历史任务的项目
  2. 点开任一历史任务(尤其是一个 190+ 条消息的大会话)
  3. 尝试发送消息 → 无响应;尝试切换模型 → 无响应
期望表现 · Expected behavior

点开历史任务后应正常加载历史消息,可发送消息、可切换模型/思考强度;后端 session.resumed 成功后,UI 应正常显示会话并持续接收事件流。

实际表现 · Actual behavior

点开历史任务后界面无任何响应:消息发不出、模型与思考强度控件点不动。日志显示后端已成功 resumed 并完成 model.updated,但 UI 收不到任何事件。重启客户端后才能看到消息实际已发送且 AI 已回复。必现。

ZCode 版本 · ZCode version

3.10.1.6272 (Windows desktop)

设备 / 系统 / 浏览器 · Device / OS / Browser

Windows 11 x64,版本 26200(桌面客户端,非浏览器)

截图 / 录屏 / 日志 · Screenshots / Recordings / Logs

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue on ZCode 3.10.1.6272 on Windows 11, then correlate the UI behavior with the supplied JSONL and log entries. Inspect the v4.hydrate session lookup, session.model_selection persistence, and event subscription paths mentioned in the report. Done means historical sessions load reliably, controls accept input, and resumed-session events reach the UI without database or session-not-found errors.

Written by the indexing model from the issue text.

Assessment

Domain
backend, desktop
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.