zai-org / zai-org/feedback

Win11 预览版 3.12.1:大会话 UI 黑屏/模型选择不保存(FOREIGN KEY)/项目 hooks 空 matcher 被拒载/远程「本地不在线」(关联 #608 #426 #328)

Open
#644 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority: P2
Dominant language
No language data
Stars
22
Forks
1
PR merge metrics
No merged PRs in 30d

Description

环境

  • Windows 11(10.0.26200 x64),RTX 5080,64GB 内存
  • ZCode 桌面版 v3.12.1.7207(2026-09-13 由 3.11.2 自动更新;问题在 3.11.2 上已存在)
  • 更新通道:预览版(先行版)——本机设置 receivePreviewUpdates=true 且自动更新开启;公开 changelog 最新条目为 3.11.2(2026-09-04),另一台同客户端环境的稳定版也是 3.11.2。以下问题均发生在预览版 3.12.1 上,其中部分(如 hooks 空 matcher 拒载)疑似预览版回归,可协助在稳定版上对比验证。
  • 账号:GLM Coding Plan(bigmodel-individual-coding-plan / GLM-5.3)
  • 典型使用:多项目多窗口并行(同时 3 个 app-server --stdio --surface desktop 引擎进程)

症状与频率(2026-09-11 起,4 天内 ≥5 次)

  1. 远程控制显示"本地不在线、没有连接";刷新二维码后暂时恢复,过段时间复发。从高铁(跨网络)到家中固定网络均复现。
  2. 通过远程桌面观察:ZCode 界面黑屏/无画面;重启客户端恢复。
  3. 回家后不使用远程仍复发:模型设置页 BigModel 供应商配额查询永久"查询中"转圈、无法选择模型、消息发不出。

本地日志证据(%USERPROFILE%.zcode\cli\log\zcode-2026-09-1*.jsonl 原文摘录,已脱敏)

① 引擎启动失败——供应商解析失败(3 次,2026-09-13 01:30Z):

{"level":"error","event":"bootstrap.app.startup.failed","message":"ZCode app startup failed",
 "context":{"startupKind":"zcode_app","stage":"total","totalDurationMs":313},
 "error":{"name":"ModelProtocolError","message":"Model config is missing. Create <home>\\.zcode\\cli\\config.json with an explicit model provider before running ZCode.","code":"model_config_missing"}}

注意:config.json 实际存在且为合法 JSON(当前只含 plugins / mcp 两个顶层键,无显式供应商键)。疑为多引擎并发启动时的解析竞态。

② 引擎启动失败——SQLite 迁移锁超时(2 次,2026-09-13 06:27Z):

{"level":"error","event":"zcode_protocol.startup.failed",
 "error":{"name":"SqliteSessionMigrationError","message":"Timed out waiting for SQLite migration lock at <home>\\.zcode\\cli\\db\\db.sqlite",
 "cause":{"message":"database is locked","code":"ERR_SQLITE_ERROR"}}}

③ 会话水合失败——每天 2~22 次(9/13 峰值 22 次):

{"level":"warn","event":"zcode_protocol.v4.gateway_error",
 "context":{"phase":"loadPersistedEvents","persistedMessages":0,"error":"Session not found: sess_xxx","scope":"v4.hydrate"}}

④ 模型流间歇性失败(9/13 七次,status=cancelled,attempt 最高 6/11):

{"level":"error","event":"model.sdk.stream.failed",
 "context":{"baseURL":"https://open.bigmodel.cn/api/anthropic","modelId":"GLM-5.3","providerId":"account:bigmodel-individual-coding-plan","transport":"sse","status":"cancelled"}}

放大因素(本地实测)

  • 单个长期会话的 sessionEventSequenceNumber 已达 300,000+(#426 报告 190+ 条消息即 100% 复现 UI 无响应)
  • db.sqlite 已 525MB,WAL 54MB
  • 多窗口 = 多个 app-server 共享同一 db / config,锁竞争随并发上升
  • Windows 事件日志(Application, Id=1000)9/8 以来 ZCode 崩溃记录——黑屏不是渲染进程硬崩,符合 #608(runtimeRestarted 后黑屏)的表现

已尝试

  • 重启客户端:临时恢复(与 #608 一致)
  • 刷新远程二维码:临时恢复(与 #328 "换 deviceSid 缓解" 一致)
  • 升级 3.11.2 → 3.12.1:未解决

补充(2026-09-14 晚,本地复诊)

  • 引擎侧已清洁复测:结束全部进程树 + PRAGMA wal_checkpoint(TRUNCATE) 后,当日 12 次 bootstrap.app.startup.completed 全部成功database is locked / model_config_missing 归零——但 UI 仍黑屏 → 问题在渲染/合成层,非引擎锁。
  • System 事件日志存在 nvlddmkm(NVIDIA 驱动)Event ID 153 错误:8/31 ×2、9/2 ×3、9/7 ×1、9/13 21:13 ×2(与当晚在家的黑屏时段吻合)。RTX 5080 / 驱动 610.62。
  • 一次重启后 Electron 配置档案被重建(Preferences 回到 520 字节默认值、Local Storage leveldb 清空),触发"新用户第一次使用"引导弹窗;~/.zcode/v2/credentials.json、db.sqlite、setting.json 均完好。
  • 期望补充:Chromium GPU 进程/合成器失效时,客户端应自动降级软件渲染或至少给出可见提示与自动恢复,而不是整窗黑屏需手动重启。

补充二(2026-09-14 晚,第二轮)

  • session.model_selection.persist_failedFOREIGN KEY constraint failed(session 表外键约束失败,sessionId=sess_xxx, providerId=account:bigmodel-individual-coding-plan, modelId=GLM-5.3-Flash)——与 #426 报告的外键约束失败一致,直接导致"模型选择无法保存/无法选模型"。
  • 3.12.1 新增配置校验构成破坏性变更:项目级 .zcode/config.json 中 hooks 的 "matcher": ""(空字符串,旧版本合法)被 config_file_invalid 整体拒载(诊断:hooks.events.SessionStart.0.matcher: Too small: expected string to have >=1 characters 等 5 处),导致该项目 hooks 全部失效(当日 hook.run.failed 80 次)。建议兼容空 matcher 或迁移提示。
  • 配置档案重建后重新登录时,OAuth 授权页等待弹窗("等待 bigmodel 完成认证")永不完成,需取消+完全重启重试;建议给出超时与重试指引。
  • 直连网络实测(VPN 关闭):open.bigmodel.cn HTTP 200 / 总耗时 0.25s;zcode.z.ai HTTP 307 / 0.52s——端点本身健康,当日 9 次 ECONNRESET / 9 次 fetch failed 集中于系统代理开启时段(127.0.0.1:7897)。
  • 官方插件 MCP image_search(HTTP,${ZCODE_BASE_URL}/api/v1/mcp/server/image_search,认证方式 zcode_official / jwt_token)在账号需要重新登录期间每个新会话固定 5 秒握手超时("Version negotiation probe timed out after 5000ms"),同批出现多次 mcp.official_auth.resolve 告警——直接拖慢每条消息的会话启动。建议:MCP 认证失败应缓存失败状态并跳过,而非每个会话重复阻塞等待。
  • 界面配置档案一次重建后(Preferences 恢复默认),出现"新用户第一次使用"引导与重新登录流程;OAuth 等待弹窗("等待 bigmodel 完成认证")曾长时间不完成。

期望

  1. 大会话(10万+ 事件)打开时的 hydrate 性能与 UI 兜底(加载失败应可重试/降级,而不是黑屏)
  2. 多 app-server 并发下 config 解析与 SQLite 迁移锁的竞态修复
  3. 远程控制 relay 会话状态污染(#328)的服务端修复
  4. 供应商选择被重置回 OAuth 个人套餐(#391/#483)的持久化修复
  5. 关闭"接收预览更新"后,是否有官方途径回退/覆盖安装到最新稳定版(3.11.2)?预览版遇到阻塞性问题时的建议回退路径希望有文档说明。

完整日志(zcode-2026-09-08 ~ 09-14 jsonl,约 80MB)可按需提供。

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

This report combines several failures across the desktop client, including .zcode/cli/log/zcode-2026-09-1*.jsonl, .zcode/cli/config.json, .zcode/cli/db/db.sqlite, project .zcode/config.json, and the Electron profile. Start by separating the black-screen, SQLite/model persistence, hooks validation, relay, and authentication symptoms into reproducible issues and compare them with #328, #426, and #608. Done requires an isolated scope, a confirmed reproduction, and a focused fix or documentation path for each component.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, sqlite
Domain
authentication, databases, desktop, networking
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.