Skip to content

fix(integrations): drop unsupported --model flag from ZCode dispatch - #5009

Open
yxshee wants to merge 1 commit into
github:mainfrom
yxshee:fix/zcode-dispatch-model-flag
Open

yxshee wants to merge 1 commit into
github:mainfrom
yxshee:fix/zcode-dispatch-model-flag

Conversation

@yxshee

@yxshee yxshee commented Oct 17, 2026

Copy link
Copy Markdown

Description

The ZCode CLI has no --model option. ZcodeIntegration inherits SkillsIntegration.build_exec_args(), which appends --model <model>. Any workflow step that dispatches to zcode with a model: set (on the step or as the workflow default) therefore fails before ZCode starts.

ZCode parses its arguments with node:util parseArgs in strict mode. The option table has prompt (-p) and output-format, but no model:
apps/zcode-cli/packages/cli/src/arguments.ts#L3-L109 (strict: true at L108; aac4755 is the v3.15.1 commit and the current tip of main).

A parse error is written to stderr with the help text, and the CLI returns exit 1:
run.ts#L324-L336.

The CLI help lists -p, --prompt <text> but no model flag. Models are switched in-session with /model [id]:
en-US.ts#L28-L65.

--output-format accepts text, json and stream-json:
run.ts#L117.

Reproduction: I ran ZCode's unmodified parseGlobalArgs option table from arguments.ts (L3-L109) under Node 26's util.parseArgs against the argv this integration builds on current main:

FAIL zcode -p $speckit-specify build a login page --model glm-5 --output-format json -> ERR_PARSE_ARGS_UNKNOWN_OPTION: Unknown option '--model'
FAIL zcode -p $speckit-specify build a login page --model glm-5 -> ERR_PARSE_ARGS_UNKNOWN_OPTION: Unknown option '--model'
OK   zcode -p $speckit-specify build a login page -> {"prompt":"$speckit-specify build a login page"}
OK   zcode -p $speckit-specify build a login page --output-format json -> {"prompt":"$speckit-specify build a login page","output-format":"json"}

I did not run the zcode binary itself; the evidence is ZCode's own parser definition and error path linked above.

Fix, following the shape of the Vibe (#4784), Forge (#4668) and Amp (#4581) fixes:

  • keep -p <prompt> and --output-format json, which ZCode accepts
  • drop model: ZCode has no per-invocation model flag

ZCode is one of the integrations still inheriting the unverified default argv tracked in #2416.

Testing

  • Tested locally with uv run specify --help

  • Ran existing tests with uv sync && uv run pytest

  • Tested with a sample project (if applicable): no zcode binary available; see the parser reproduction above

  • New tests in tests/integrations/test_integration_zcode.py: prompt mode, --output-format json, model dropped, and extra args via SPECKIT_INTEGRATION_ZCODE_EXTRA_ARGS. The model and extra-args tests fail on main (--model is present in the argv) and pass with the change.

  • tests/integrations, tests/workflows and tests/test_agent_config_consistency.py: 3547 passed, 8 skipped.

  • Full suite (macOS, Python 3.13): 12334 passed, 376 skipped. 11 failures in tests/test_*_python_parity.py occur identically on unmodified main on this machine under full-suite load; those three files pass when run on their own (126 passed, 37 skipped).

  • uvx ruff@0.15.0 check src tests: clean

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance (fill in the disclosure below)

AI disclosure: Claude Code (model: Claude Opus 5.5, max reasoning effort, autonomous agent mode) opened this PR on behalf of @yxshee. It wrote the code change, the regression tests and this description, and ran the tests listed above. A Claude Code research subagent (model: Claude Sonnet 5.5, autonomous) read ZCode's public source to identify the missing flag. No human reviewed the change line by line before it was opened.

🤖 Generated with Claude Code

The ZCode CLI has no --model option, and it parses its arguments with
node:util parseArgs in strict mode. The inherited
SkillsIntegration.build_exec_args() appends --model whenever a workflow
step or workflow default sets model:, so the dispatched step exits 1
with "Unknown option '--model'" before ZCode runs.

Keep -p and --output-format json, which ZCode accepts, and drop model:
ZCode has no per-invocation model flag and switches models in-session
with /model.

Assisted-by: Claude Code (model: Claude Opus 5.5, autonomous)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@yxshee
yxshee requested a review from mnriem as a code owner October 17, 2026 19:02
@mnriem mnriem added the triage-must-have Verdict: high-value, important work for Spec Kit — do first label Oct 18, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage-must-have Verdict: high-value, important work for Spec Kit — do first

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants