[Bug] 3.11.2 Windows:自定义 Provider 可选、已启用,发送后必现 switchModelConfig 未在首发前收敛: failed provider.notInRegistry
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.
(查重备注:与 #452(3.10.2 macOS 同族多 provider 同名模型切换后旧会话报"模型已不可用")错误字符串完全一致,本 issue 是同一根因在 3.11.2 Windows 上、自定义(第三方)provider 场景的复现,附直连 API 对照证据,确认非接口/配置问题。)
问题类别 · Category
模型设置 / 切换 · Model config
涉及的 Agent 框架 · Agent framework
ZCode Agent(自研)
严重程度 · Severity
阻塞使用 · Blocking (无法使用核心功能 / core function unusable)
复现频率 · Reproducibility
必现 · Always
问题描述 · Description
ZCode Desktop 3.11.2(Windows)下,自定义 Provider(Anthropic 兼容协议,https://api.b.ai,模型 glm-5.3-flash)完整走 UI 流程配置后:
- 设置 → 模型设置 → 添加供应商:名称、Anthropic Base URL
https://api.b.ai、API Key、Add Model 填入模型 IDglm-5.3-flash、启用开关打开 —— 全部正常,模型设置面板显示「已启用」,模型列表显示glm-5.3-flash 视觉 1M。 - 模型选择器能列出该 provider 与模型,选中后输入框模型 chip 更新为「B.AI 免费 GLM-5.3-Flash/ glm-5.3-flash」。
- 发送任意消息 → 必现「当前使用的模型已不可用,请从当前模型列表中选择一个可用模型后继续」,点「查看详情」:
switchModelConfig 未在首发前收敛: failed provider.notInRegistry
- 日志(
~/.zcode/v2/logs)同步出现:
历史 session 模型已不可用,拒绝按默认模型恢复 {"modelId":"glm-5.3-flash","providerId":"builtin:chat-bai",...}
workspace/updateProviderRegistry {providerCount:1, revision:"sha256:3a8543548b3f75bc99e473ad170eca532de414f36bf37574210862b87b391089", status:"unchanged"}
自定义 provider 始终未进入 agent 侧模型注册表(providerCount 恒为 1、revision 恒定不变,重启多次亦如此)。
已排除的干扰项:
- 接口本身完全正常:直连
POST https://api.b.ai/v1/chat/completions(同 key、同模型)返回 200 + 正常内容(content: "pong")。 - config.json 中该 provider 条目(
builtin:chat-bai)结构与内置 provider 一致(kind/anthropic、options.apiKey/baseURL、models),且由应用自身在 UI 操作后写回。 - 完全退出并重启应用(含托盘)后复现。
补充观察:同样的自定义 provider(NVIDIA NIM、SenseNova)在模型选择器可见但同样无法作为任务模型使用;用户感知为「哪个都不好使」。
复现步骤 · Steps to reproduce
- 打开 ZCode → 设置 → 模型设置 → 添加供应商
- 名称
bai,Anthropic Base URLhttps://api.b.ai,填 API Key,点「添加模型」输入模型 IDglm-5.3-flash,打开启用开关 - 回到聊天输入框,点模型选择器,选「B.AI 免费 GLM-5.3-Flash / glm-5.3-flash」(选择器能选中,chip 正常更新)
- 发送任意消息
- 看到「当前使用的模型已不可用,请从当前模型列表中选择一个可用模型后继续」;查看详情 =
switchModelConfig 未在首发前收敛: failed provider.notInRegistry
期望表现 · Expected behavior
自定义 Anthropic / OpenAI 兼容 Provider 应能作为主智能体模型正常使用(官方文档「Custom Providers」章节明确支持;#293 证明 v3.7.6 上 qwen3.7-max 自定义 OpenAI 兼容模型可作主智能体)。选择、发送后应正常出流。
实际表现 · Actual behavior
必现 provider.notInRegistry:UI 层能看到/选中自定义 provider,但 agent 侧模型注册表(providerCount:1,revision 不变)从不包含自定义 provider,switchModelConfig 无法收敛,会话卡死在「模型已不可用」。
ZCode 版本 · ZCode version
v3.11.2(Windows x64)
设备 / 系统 / 浏览器 · Device / OS / Browser
Windows (win32),工作区 C:\Users\Administrator\ZCodeProject
截图 / 录屏 / 日志 · Screenshots / Recordings / Logs
- 错误详情截图:
switchModelConfig 未在首发前收敛: failed provider.notInRegistry - 日志路径:
~/.zcode/v2/logs/2026-09-07.log(含历史 session 模型已不可用,拒绝按默认模型恢复与workspace/updateProviderRegistry providerCount:1记录) - 直连 API 对照:
POST https://api.b.ai/v1/chat/completions→ 200,"content":"pong"(证明 key/模型/端点均正常,非上游问题)
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 config.json and the logs under ~/.zcode/v2/logs, reproducing the selection and send flow described in the issue. Trace switchModelConfig and workspace/updateProviderRegistry to see why the custom provider is absent from the agent registry. Done means a configured custom provider appears in that registry and a selected model can send and stream a message successfully.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100