[Bug] CLI 0.16.5 headless --prompt: personal provider in provider_config.json never enters registry (providerCount=0) — "Select a model before continuing" even with valid Coding Plan key
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 22
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
CLI 0.16.5 headless --prompt 无法使用手工配置的 BigModel Coding Plan provider:personal provider 永远进不了 registry
环境
- macOS 15.x (arm64)
- ZCode Desktop 3.12.3;内置 CLI
zcode 0.16.5(/Applications/ZCode.app/Contents/Resources/glm/zcode.cjs) - 账号:GLM Coding Plan(bigmodel-individual-coding-plan),Desktop GUI 已登录且完全正常
- 无独立 CLI 分发(
@zcode/tui未随包,TUI 无法启动),只能走app-server/--prompt
复现
按官方 FAQ「终端与桌面是分开的入口、CLI 用 config.json 的 provider + API Key」配置:
~/.zcode/cli/config.json:provider["bigmodel-coding-plan"] = { kind: "anthropic", options: { baseURL: "https://open.bigmodel.cn/api/anthropic", apiKey: <valid coding-plan key> }, models: {...}, source: "custom" },model.main = "bigmodel-coding-plan/GLM-5.3"~/.zcode/v2/provider_config.json:providerConfigRules.providerRules写入同 id 的 personal provider 实例(api.type=anthropic-messages、access.type=api-key、personalModelIds),modelConfigRules.configuredDefaultModelSelection指向它- 运行:
$ ZCODE_BUILTIN_PROVIDER_CONFIG_FILE=/Applications/ZCode.app/Contents/Resources/config/provider/zcode-builtin.json \
node /Applications/ZCode.app/Contents/Resources/glm/zcode.cjs --prompt "回复 PONG" --mode plan
Error: Model creation failed
# 日志: turn.failed / turnPhase=model_creation / "Select a model before continuing" (CONFIGURATION_ERROR)
关键证据:registry 从未收到 personal provider
~zcode_protocol.provider_registry.ready 事件中 configRevision 始终为 [builtin-rev, hash] 且 providerCount: 0 —— 无论 provider_config.json 里写了什么,personal provider 都没有进入 registry 合成。
对照 #693(headless 选错 provider 404):我们这边更早一步——headless 连 provider 都选不出来。两案共同点:0.16.5 headless 会话不遵守 GUI 的模型选择,也不给用户手动指定的入口。
已排查(均无效)
| 尝试 | 结果 |
|---|---|
credentials.json 补 account-provider:account:bigmodel-individual-coding-plan:identity + api-key 两键(standalone registry o5t 要求的形态) |
registry 里 account:* 仍全部 entitled:false(ready 事件 accountRevision 可见),CLI config 的 provider 仍不出现 |
| provider_config.json 写完整 personal provider 实例(含明文 access.apiKey) | providerCount 仍 0 |
删除 provider_config.json 期待 legacy import(F3e/LSs 读 cli/config.json) |
文件被重建为空骨架(providers=[]、default 丢失),legacy import 不会在“文件存在”时触发 |
session/create RPC 显式传 model:{providerId:"account:bigmodel-individual-coding-plan",...} |
Provider Registry 中不存在 Model |
期望
- CLI/headless 有一条受支持的路径使用已付费的 Coding Plan(配置文件怎么写、或一条
zcode login --provider bigmodel命令)——zcode login目前硬编码 z.ai 国际版 OAuth,bigmodel 用户无入口 - personal provider 写入
provider_config.json后应进入 registry(或文档说明正确的 CLI 配置格式) - headless
--prompt支持--model provider/model参数,作为兜底 - TUI 包(
@zcode/tui)随包分发,或提供独立 CLI 安装渠道(关联 #444、#51)
附注
- GUI 与 CLI 配置不共享登录态可以理解,但 CLI 的官方文档目前缺失(docs.bigmodel.cn 的 ZCode 页只讲 GUI),FAQ 也只说“需要单独配置”而没说怎么配。对于想把 ZCode 作为 headless worker 接入调度器的用户(官方宣传的 Bot/Remote Control 之外的另一条路),这是硬阻塞。
- 环境细节:
zcode doctor正常;runtime/capabilities返回{independentPlanState:true};session/list可列出 GUI 会话(共享存储可读);standalone registry 的凭据派生(zcode-credential-fallback:platform:homedir:username→ sha256 → aes-256-gcm)与桌面进程一致,两键均可解密。
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 the bundled CLI entry point at /Applications/ZCode.app/Contents/Resources/glm/zcode.cjs and the provider_config.json and config.json files described in the report. Run the supplied headless --prompt command and inspect the provider_registry.ready event; done means the configured personal provider appears in the registry and model creation succeeds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js
- Domain
- authentication, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100