Repository navigation
Conversation
Workflow command and prompt steps can set reasoning_effort and context_size, and workflow.reasoning_effort and workflow.context_size set defaults for both. Values resolve like model: the step value, then the workflow default, then unset. An expression that resolves to an empty string or null unsets the setting for that step. Values must be strings that match a host-owned, flag-safe pattern. Malformed values are summarized rather than echoed. An integration receives a setting only if it declares the setting on the class that implements the receiving method (build_exec_args, or dispatch_command when overridden) and translates it. Otherwise the step fails before the CLI runs, with an error that names the setting and its source. The base and format-base builders raise rather than drop a setting. With both settings unset, argv and integration keyword arguments are unchanged. Step outputs record both values. Part of github#4916. Assisted-by: GitHub Copilot (model: Claude Opus 5.5, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Validation diagnostics can expose secret-bearing captured output in step errors and log.jsonl, violating the capture guarantee and requiring value-free diagnostics with regression coverage.
1 open issue
What changed in this PR
Adds per-step reasoning effort and context size to Spec Kit workflow dispatch, including the shared contract from prerequisite #5248 and native mappings addressing #4916.
Changes:
- Adds workflow defaults, expression resolution, validation, and run/resume recording for both settings.
- Maps both settings for Copilot and Codex, and reasoning effort for Claude Code, while preserving arguments when unset.
- Adds contract, adapter, and integration tests, plus documentation of support and limitations.
| File | Description |
|---|---|
tests/workflows/test_dispatch_settings.py |
Tests resolution, validation, dispatch, and resume behavior. |
tests/specify_cli/integrations/test_installed_adapters.py |
Tests installed-adapter support and legacy compatibility. |
tests/integrations/test_integration_copilot.py |
Tests Copilot flags across both layouts and dispatch paths. |
tests/integrations/test_integration_codex.py |
Tests Codex overrides and token-count validation. |
tests/integrations/test_integration_claude.py |
Tests Claude effort levels and unsupported context settings. |
tests/integrations/test_base.py |
Tests shared support declarations and validation gates. |
src/specify_cli/workflows/step/prompt/__init__.py |
Resolves and forwards prompt-step settings. |
src/specify_cli/workflows/step/command/__init__.py |
Resolves and forwards command-step settings. |
src/specify_cli/workflows/step/_dispatch_settings.py |
Shares resolution, validation, and error attribution. |
src/specify_cli/workflows/engine.py |
Validates defaults and supplies them during run/resume. |
src/specify_cli/workflows/base.py |
Appends dispatch defaults to StepContext. |
src/specify_cli/workflows/_execution.py |
Gives called workflows their own dispatch defaults. |
src/specify_cli/integrations/copilot/__init__.py |
Maps settings to native Copilot flags. |
src/specify_cli/integrations/codex/__init__.py |
Maps TOML overrides and validates context counts. |
src/specify_cli/integrations/claude/__init__.py |
Maps effort and rejects unsupported settings. |
src/specify_cli/integrations/base.py |
Defines the shared opt-in dispatch contract. |
docs/workflows/api.md |
Documents workflow defaults and options semantics. |
docs/workflow-steps/types.md |
Explains settings, support, recording, and compatibility. |
docs/workflow-steps/api.md |
Documents new context fields. |
docs/integrations/copilot.md |
Documents Copilot flags and accepted values. |
docs/integrations/codex.md |
Documents Codex overrides and context semantics. |
docs/integrations/cli.md |
Summarizes shared dispatch support. |
docs/integrations/claude.md |
Documents effort validation and context limitations. |
design/integration.md |
Defines adapter ownership and opt-in requirements. |
Review effort: Balanced (auto)
A reasoning_effort or context_size value can come from an expression over captured agent output. When such a value failed the host's format check, the error quoted a 24-character repr prefix of it. Step errors are printed and written to log.jsonl as step_failed events, so captured text could reach both, contrary to the documented guarantee that captured text is neither printed nor written to log.jsonl. The error now reports only the value's type and length. The design doc and the validate_dispatch_setting() docstring tell adapter authors to keep the value out of their own errors for the same reason. Part of github#4916. Assisted-by: GitHub Copilot (model: Claude Opus 5.5, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Translate the reasoning_effort and context_size workflow step settings to --reasoning-effort and --context on both Copilot argv paths: prompt steps through build_exec_args() and command steps through the overridden dispatch_command(). The flags follow --model. Copilot CLI validates the values itself. Part of github#4916. Assisted-by: GitHub Copilot (model: Claude Opus 5.5, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Translate reasoning_effort to -c model_reasoning_effort="<value>" and context_size to -c model_context_window=<n> after --model. context_size must be a positive whole number no larger than the i64 range that Codex accepts. Part of github#4916. Assisted-by: GitHub Copilot (model: Claude Opus 5.5, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Claude Code only warns about an unknown --effort value and then runs at its default effort, so Spec Kit checks the value against Claude's documented levels (low, medium, high, xhigh, max) before dispatch. The error names SPECKIT_INTEGRATION_CLAUDE_EXTRA_ARGS as an escape hatch for newer levels. context_size is not mapped; its error points to choosing a long-context model. Part of github#4916. Assisted-by: GitHub Copilot (model: Claude Opus 5.5, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Add the support table for GitHub Copilot, Codex CLI, and Claude Code to the workflow step reference and the shared CLI dispatch guide. Part of github#4916. Assisted-by: GitHub Copilot (model: Claude Opus 5.5, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
A dispatch setting can resolve from captured agent output, and a step error is printed and written to log.jsonl, where captured text must never appear. Claude Code's reasoning_effort check and Codex's context_size check repeated the rejected value, so captured text that passes the host's value pattern reached both. The errors now state the setting and its rule without the value. Part of github#4916. Assisted-by: GitHub Copilot (model: Claude Opus 5.5, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
e3bd6a0 to
3d58712
Compare
|
Review round 1 (Copilot code review of This branch is rebased onto #5248's new head, Changes:
Evidence on
Posted on behalf of @sukanth by the GitHub Copilot app (agent mode, Agent merge, autonomous) with Claude Opus 5.5 at maximum reasoning effort. AI wrote the fix, the tests, and this summary, and ran all of the testing; no human reviewed them line by line. |
|
Please address Copilot feedback |
The Copilot feedback on this PR is the one thread on Posted on behalf of @sukanth by the GitHub Copilot app (agent mode, Agent merge, autonomous) with Claude Opus 5.5 at maximum reasoning effort. AI wrote this reply; no human reviewed it before posting. |
|
The Copilot feedback is addressed, and that review conversation is resolved. This PR remains blocked pending the merge of #5248; once that prerequisite merges, please rebase this branch to remove the prerequisite commits so the remaining changes can receive final review before merging. AI disclosure: Posted on behalf of @mnriem by the GitHub Copilot app using GPT-6.1 Sol in interactive agent mode. AI drafted and posted this comment at the maintainer’s direction; model settings are not exposed to the agent. |

Description
Closes #4916.
Builds on #5248, which adds the shared per-step dispatch-settings contract. That PR must merge first; until then, this branch also contains its two commits. Once it merges, only the five commits below remain. This split follows Integration pull requests.
This PR maps the workflow step settings
reasoning_effortandcontext_sizeto the native CLI arguments of three integrations. It has one commit per integration, one docs commit, and one review fix.reasoning_effortcontext_size--reasoning-effort <v>--context <v>-c model_reasoning_effort="<v>"-c model_context_window=<n>context_sizemust be a positive whole number with no leading zeros, at most2**63 - 1, the range Codex's i64 config accepts.--effort <v>model.reasoning_effortmust below,medium,high,xhigh, ormax. Claude Code 2.1.318 only warns about other values and runs at its default effort.build_exec_args()for prompt steps, and the overriddendispatch_command()for command steps.--modeland before--output-format.-coverrides go after--model. A value is embedded as a TOML string only after it passes the host's value check, so it cannot contain quotes, backslashes, or control characters.ClaudeIntegrationnow ownsbuild_exec_args(). It callssuper()without the settings, which validates the runtime configuration once and builds the base argv. It then runs the gate and appends--effort.super()'s argv unchanged.SPECKIT_INTEGRATION_CLAUDE_EXTRA_ARGS="--effort <value>".context_sizeerror and the Claude Codereasoning_efforterror state the rule but not the value. A value can come from captured agent output, which Spec Kit does not print to the terminal or write tolog.jsonl.cmp. The snapshot covers:build_exec_argsanddispatch_command;--yoloon and off;EXTRA_ARGSset and unset;output_json, streaming, and bounded capture.docs/workflow-steps/types.mdgets a support table and the Claude example line.docs/integrations/cli.mdlists the built-in support.Testing
The agent described in the AI disclosure ran all of the testing below. Nothing was run by hand. The commands ran against this PR's head commit,
3d587126, in a clean worktree.uv run specify --help: exit 0.uv sync && uv run pytest, in an equivalent.venv. Results are below.uvx ruff@0.15.0 check src testsnpx markdownlint-cli2@0.23.2on the eight changed docs.venv/bin/python -m pytest tests/workflows tests/test_workflows.py tests/integrations tests/specify_cli/integrations tests/test_agent_config_consistency.py -q -n 6-k DispatchSettingsin the three integration test files).venv/bin/python -m pytest -q -n 6(full suite), then a serial re-run of every failure-n 6: 14325 passed, 365 failed, 132 skipped. All 365 failures are in the setmainfails under the same command: shell-script and parity suites that fail under parallel load on this machine. A serial re-run of those 365 passed 364. The remaining test is the environment-specifictest_non_windows_uv_tool_dry_run_still_previews_installer, which also fails onmainhere.Before and after. On
e3bd6a0d, the new integration tests ran twice against the prerequisite PR's contract: once with the three integration modules frommain, and once with this PR's modules. For the first run, the Claude module frommaingot only theEFFORT_LEVELSconstant, so that the test module imports.EXTRA_ARGSescape hatch.Review fix. The six tests added in
3d587126feed captured output that passes the host's value check into the Codexcontext_sizeand the Claude Codereasoning_effort, both directly and through command and prompt steps. All six failed on the rebasedcc6ce181, whose errors repeated the value, and pass on3d587126.Test selection reasoning
src/specify_cli/integrations/copilot/__init__.pyspecify workflow runcommand and prompt steps with Copilotsrc/specify_cli/integrations/codex/__init__.py,claude/__init__.pyspecify workflow runwith Codex or Claude Codedocs/**Manual test results
Agent: GitHub Copilot CLI 1.0.106, run by
specify workflow runthrough an argv-logging probe that appends--version. The real CLI parses Spec Kit's argv without making a model call. Claude Code 2.1.318 and Codex CLI 0.165.0 were checked at the parser level only. OS/Shell: macOS / zshspecify workflow runwith three steps: command stepplan(reasoning_effort: "{{ inputs.effort }}",context_size: long_context); prompt stepreview(inheritsworkflow.reasoning_effort: medium); command steptasks(opts out withreasoning_effort: "{{ inputs.tasks_effort }}", an input that defaults to""; a literal""would inherit the default)--reasoning-effort low --context long_context, then--reasoning-effort medium, then no new flags. All three steps completed with exit 0. The run state records each step's values:low/long_context,medium/null, andnull/null.specify workflow runwithreasoning_effort: turboandcapture: trueCommand exited with code 1. The CLI'sinvalid value 'turbo'message is inoutput.stderr.specify workflow runin which acapture: trueprompt step's output (FAKEsecret0123456789, printed by a stand-in executable) feeds the next step'scontext_size(Codex) orreasoning_effort(Claude Code)log.jsonl, or the console output. One3bd6a0dit was in all three.--effortand Codex-coverridesclaude -p … --effort bogusonly warns, which is why Spec Kit validates the level.codex exec -c 'model_reasoning_effort="high"'reportsreasoning effort: high. A non-integermodel_context_windowis rejected (expected i64).AI Disclosure
AI disclosure: Implemented with the GitHub Copilot app in agent mode, running autonomously on behalf of @sukanth, who chose the issue and directed the work. An orchestrator and four implementation workers, all Claude Opus 5.5 at maximum reasoning effort with long context, wrote the change. Before implementation, a panel of five models reviewed and approved the plan: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.1 Sol, and GPT-5.6 Sol at maximum reasoning effort, and Gemini 4 Argon at high reasoning effort, all with long context. The same panel reviewed the code, and the agent fixed the findings it accepted. Extent: AI generated the code, tests, docs, and this description, and the agent ran all of the testing. No human reviewed the change line by line before submission. AI-generated follow-up commits and review replies will carry their own disclosure. The first review fix (
3d587126) and this description's re-run were done by the Agent merge session for this PR, also Claude Opus 5.5 at maximum reasoning effort, with no line-by-line human review.