Skip to content

[Bug] CLI 0.16.9 headless:legacy 导入的 model.main 成为 defaultModelSelection,但启动时实际选中第一个 provider 的第一个模型 / imported default model ignored at startup, falls back to first model #811

Open

Description

@striver2006

提交前确认 · Pre-submission checklist

问题类别 · Category

模型设置 / 切换 · Model config

涉及的 Agent 框架 · Agent framework

ZCode Agent(自研)

严重程度 · Severity

影响体验 · Major(headless 调用静默跑在另一个模型上,没有任何报错或提示)

复现频率 · Reproducibility

必现 · Always

问题描述 · Description

headless 模式下,cli/config.json 的 model.main 被 legacy 导入为 defaultModelSelection(导入本身成功),但启动时实际选中的是第一个 provider 的第一个模型,之后的模型请求也都发给它。

In headless mode, model.main from cli/config.json is imported as defaultModelSelection (the import itself succeeds), but at startup the runtime selects the first model of the first provider instead, and all subsequent model requests go to that model — silently.

复现步骤 · Steps to reproduce

  1. 新建空目录作 HOME,写 <HOME>/.zcode/cli/config.json:一个 source: "custom" 的 provider,models 里依次两个模型 A、B;model.main 与 model.lite 都写 <provider>/B。
  2. 不设 ZCODE_PERSONAL_PROVIDER_CONFIG_FILE(让 CLI 走 legacy 导入),以该 HOME 跑一次 headless --prompt。
  3. 查看 <HOME>/.zcode/v2/provider_config.json 的 defaultModelSelection,以及 <HOME>/.zcode/cli/log/*.jsonl 里 bootstrap.app.startup.runtime_config.completed 事件的 context.model。

期望表现 · Expected

启动选定为 <provider>/B。

实际表现 · Actual

defaultModelSelection 是 <provider>/B(导入成功),但启动事件的 context.model 是 <provider>/A;之后的模型请求也都发给 A。

附证:只把 models 里 B 挪到 A 前面、其余不变,启动选定随之变成 B。可见默认选择在运行期被判为不可选,回落到第一个可见 provider 的第一个模型。

线索(未证实):静态阅读推断,legacy 导入写出的默认选择只有 { providerId, modelId }、不带思考档位,可选性检查因此判它不可选(成因码疑似 reasoning-level-missing)。这一条只作线索,没有在调用路径上验过。

环境 · Environment

  • ZCode 桌面端 3.14.3(macOS 27.0,Apple Silicon)
  • ZCode CLI 0.16.9(应用包内 Resources/glm/zcode.cjs,sha256 前 16 位 b1df2ef3e5bd76c4),以 node zcode.cjs --prompt … 方式 headless 调用
  • 独立 HOME(上面的最小配置),provider 为 source: "custom"

日志 · Logs

未附:我们实际运行的日志含业务内容。上面的最小复现不含任何凭据,需要的话可以按它产出一份干净的日志与 provider_config.json 附上。

Activity

  1. github-actions commented on Sep 24, 2026

    @github-actions

    👋 感谢你的反馈,我们已经收到。

    • 维护者看到后会尽快回复你。
    • 状态保持为 status: 待评估,你可以随时补充信息。
    • 信息不全时我们会打上 needs: 更多信息 标签并 @ 你。

    👋 Thanks — we've received your issue.

    • A maintainer will get back to you as soon as we can.
    • Status stays at status: 待评估 (Triage); feel free to add context.
    • If we need more details, we'll add needs: 更多信息 and ping you.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions