Commit 5bf5cb0
fix(integrations): dispatch Forge via prompt flag only
Fixes #4666.
`ForgeIntegration` never overrode `build_exec_args()`, so it inherited
`MarkdownIntegration`'s generic `-p <prompt> --model <model>
--output-format json`. Forge accepts `-p/--prompt`, but `--model` and
`--output-format` do not exist in its CLI, so every workflow
`command:`/`prompt:` step targeting Forge aborted at argument parsing
with `error: unexpected argument '--model' found` (exit 2) before the
agent ever ran.
Unlike the Amp case, both inherited extras are invalid, so both dispatch
paths broke: `stream=False` appends `--output-format json`, while
`stream=True` still appends `--model` whenever a model is configured.
The only surviving combination was `stream=True` with no model, which
reduces to plain `forge -p <prompt>`.
`model` is deliberately dropped rather than remapped: Forge exposes no
model-selection flag. Model choice is a persisted setting (`forge config
set model`), and `--agent` takes an agent ID, not a model identifier, so
forwarding the caller's model onto it would silently select the wrong
thing. `output_json` is dropped for the same reason: Forge's
machine-readable `--porcelain` exists only on certain subcommands, not
on the top-level prompt invocation.
Extra args from `SPECKIT_INTEGRATION_FORGE_EXTRA_ARGS` are applied
before `-p`, matching the opencode / goose / codex ordering; Forge
parses its global flags ahead of the prompt flag.
Same fix shape as the one-off overrides for Amp (#4581), opencode
(#2409) and goose (#3781). Part of the audit in #2416.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent b9e7389 commit 5bf5cb0
2 files changed
Lines changed: 99 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
106 | 137 | | |
107 | 138 | | |
108 | 139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
284 | 352 | | |
285 | 353 | | |
286 | 354 | | |
| |||
0 commit comments