[Bug][Agent CLI 3.11.2-24] 默认模型失效回退到未鉴权 zai provider;会话恢复回放全部后台任务记录
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 22
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
环境
- zcode-app-cli 3.11.2-24(npm 全局)/ zcode-runtime 0.16.5 / 桌面端 App 3.11.2
- macOS 15 arm64(Apple M4)/ node v22.14.0
- 登录方式:OAuth(bigmodel 通道)
Bug A:持久化默认模型失效后,回退到未鉴权的 zai provider(新会话无法发送)
复现步骤
~/.zcode/cli/config.json持久化默认模型设为model.main = "bigmodel/glm-5.2"(该值来自旧的 model-catalog)- 服务端下发的新版
~/.zcode/cli/model-catalog-managed.json中该模型已被移除(当前仅含bigmodel/glm-5.3与bigmodel/glm-5.3-flash) - 启动新会话,直接发送消息
实际行为
会话模型被自动设为 zai/glm-5.3-flash(provider zai 在本机从未配置任何凭据),发送报错:
Session model now: zai/glm-5.3-flash · saved defaults unchanged.
Model access is not configured for zai. Run /login or /setup in zcode, or configure its API key before sending a prompt. No model request was sent.
期望行为
持久化默认模型不在 managed catalog 时,应回退到同一已鉴权 provider 下的有效模型(如 bigmodel/glm-5.3),或在启动时显式提示"默认模型已失效,请选择",而不是静默切到一个未配置凭据的 provider 让用户撞报错。
备注
手动 /model bigmodel/glm-5.3-flash 后一切正常;且 config.json 的 model.main 在会话退出时未被执行时修正(下次启动仍复现)。
Bug B:重启/恢复会话时,回放全部"后台任务执行完毕"记录
复现步骤
- 在一个长会话中产生多个后台任务/子代理(本例:9 个 subagent_child 会话 + 72 条 todo 条目,会话累计 273K tokens)
- 退出 CLI 后重新启动并恢复该会话
实际行为
启动即向转录回放大量"后台任务执行完毕"记录与 todo 条目,一次性刷屏;恢复的会话每回合携带 172K 输入 tokens,流式输出速度极慢(单请求实测 397s)。
期望行为
- 已完成的后台任务记录恢复时折叠/仅计数(如"9 个后台任务已完成,/activity 查看"),或提供增量/未读回放开关
- 大上下文会话的恢复考虑自动 compact 提示
附带(轻量)
桌面端内置的 zcode.cjs 直接以 node zcode.cjs 运行报 Cannot find package '@zcode/tui'——App 不随发终端 TUI 包,建议在文档明示终端用法(或包内附带 TUI)。
谢谢!
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 with ~/.zcode/cli/config.json and model-catalog-managed.json, then trace the CLI entry points for default-model selection and session restoration. Reproduce both cases using the listed model values and a restored large session; done means fallback stays within an authenticated provider or prompts clearly, completed tasks are not replayed in full, and the zcode.cjs TUI requirement is documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js
- Domain
- cli, documentation, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100