Repository navigation
Fix per-prompt model selection for headless runs - #197
Merged
Merged
Conversation
Contributor
|
pkg-pr-new preview for commit npx --yes https://pkg.pr.new/zcode-app-cli@e692996This preview uses the selected commit. PR updates publish automatically after CI succeeds; kingsword09 can also request a preview with |
kevingatera
marked this pull request as ready for review
October 7, 2026 02:40
kingsword09
approved these changes
Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Headless prompts have no per-run model option.
zcode --model provider/model --prompt ...fails with an unknown-option error, so choosing Flash requires changing the saved default.Changes
Add
--model <provider/model>for--promptand-p. The launcher passes the choice to the runtime, which applies it after restoring the session and before submitting the prompt. The selection is transient, so the saved default stays unchanged. Unknown models fail before a request is sent.Verification
On Linux, explicit GLM-5.3 and GLM-5.3-Flash prompts both returned
ok. The CLI usage DB recorded the requested model throughaccount:zai-individual-coding-plan, with statuscompleted. CLI provider configuration and Desktop credential/config files stayed unchanged. An unavailable provider/model failed without falling back.Focused tests, all 20 Node tests, typecheck, runtime checks, and independent review passed.