Skip to content

zcode CLI: headless --model flag, model field in --json envelope, and standalone accounts for app-server #907

Description

@Dandroid-D

Context

Heavy headless/automation user of the zcode CLI (0.16.9, zcode --prompt) with a GLM coding plan. Three connected requests that would make per-dispatch model routing first-class for automation.

1. --model flag (or env) for headless prompts

zcode --prompt always runs the default model. Automation needs to pick the model per dispatch — e.g. route mechanical work to GLM-5.3-Flash to conserve GLM-5.3 quota (Flash's quota is separate and much larger, which makes this the single highest-leverage cost feature for plan users running automation). Today there is no CLI/env way to select a model headlessly.

2. Report the model in the --json envelope

The one-shot envelope carries sessionId, usage, projection — but not which model served the turn. Cost routing and audit need a model field on every result envelope (ideally per modelRequest when a turn spans models).

3. Standalone accounts for zcode app-server --stdio

We drive the app-server protocol directly for orchestration: NDJSON over stdio, bidirectional handshake (session/requestRuntimePreferences), session/create / session/send with per-send modelSelection {providerId, modelId} — all of which works well. However, on a bare app-server the provider registry stays empty: accounts appear to arrive only via a Desktop-side provider/updateAccountConfig push that carries credential material, so session/setModel and per-send modelSelection both fail the turn for headless orchestrators. A flag or env letting the app-server self-load the CLI's own logged-in accounts (standalone-account mode) would make the protocol usable without forwarding credentials from the client.

Happy to share protocol traces if useful — thanks!

Activity

  1. github-actions commented on Oct 2, 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