fix(integrations): drop invalid --model/--output-format flags from Forge dispatch - #4667
Open
chelsealong wants to merge 1 commit into
Open
chelsealong wants to merge 1 commit into
chelsealong wants to merge 1 commit into
Conversation
…rge dispatch ForgeIntegration never overrode build_exec_args(), so it inherited MarkdownIntegration's default, which appends --model and --output-format. Neither flag exists in the Forge CLI, so every workflow command/prompt step dispatched to Forge failed immediately with exit code 2. Forge only accepts -p/--prompt; model is set out of band via `forge config set model`, so it is dropped rather than remapped. Fixes github#4666
This branch has not been deployed
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.
Summary
ForgeIntegrationnever overrodebuild_exec_args(), so it inherited the genericMarkdownIntegrationimplementation, which appends--model <model>and--output-format json. Neither flag exists in the Forge CLI (forgeonly accepts-p/--prompt,--conversation,--directory,--sandbox,--verbose,--agent,--event), so every workflowcommand:/prompt:step dispatched to Forge failed immediately at argument parsing with exit code 2.Fixes #4666.
This overrides
build_exec_args()inForgeIntegration(src/specify_cli/integrations/forge/__init__.py) to emitforge -p <prompt>only, applying theSPECKIT_INTEGRATION_FORGE_EXTRA_ARGSoperator override before-p(Forge's global flags parse before the prompt flag, matching the existing opencode/goose/codex/cursor-agent ordering).modelis intentionally dropped rather than remapped onto--agent, since--agentselects an agent ID, not a model — model selection in Forge is a persisted setting (forge config set model). Same fix shape as the existing overrides for Amp (#4581), opencode (#2409) and goose (#3781).Test plan
Added
TestForgeExecArgstotests/integrations/test_integration_forge.pycovering:-p <prompt>is emitted (no--model/--output-format)output_json=Truedoes not append--output-formatmodel=...does not append--modelor--agentSPECKIT_INTEGRATION_FORGE_EXTRA_ARGSis applied before-pVerified the new tests fail without the fix (via
git checkout HEAD -- src/specify_cli/integrations/forge/__init__.pyto restore the inheritedMarkdownIntegration.build_exec_args, confirming exit code 2 shape):With the fix restored:
ruff checkpassesAI disclosure
This change was authored by an AI coding agent (Claude Code).
🤖 Generated with Claude Code