Relationships
#1080 runModel(): options.arguments never reach the child's per-method arguments — merged into globalArgs, then dropped or rejected
Opened by mgreten · 7/10/2026· Shipped 7/11/2026
Hi again! Second small finding from our context.runModel() migration today (same session as #1077 — and once more, thank you for this feature; the design is exactly what our nested-composition setup needed).
While converting our extensions we found that per-method arguments don't reach the child method in 20260710.223351.0. We hit it empirically first, then traced it in source at fb93097:
What we observe (two forms, two failures):
- By-definition form:
context.runModel({ definition: "cli-agent", method: "invoke", arguments: { prompt: "..." } })→ the child'sinvokeseesprompt: undefinedand fails with "Method arguments validation failed". - By-type form (fresh name): → "Global arguments validation failed: Unknown argument(s): prompt, provider, ..." — the target's strict globalArguments schema rejects the method-arg keys outright.
Where it seems to come from:
src/domain/models/model_invocation_service.ts:171-173mergesoptions.argumentsoverdefinition.globalArgumentsand passes the result as the child context'sglobalArgs— method args are never populated separately.src/domain/models/method_execution_service.ts:169then reads the child's method arguments from the persisted definition (definition.getMethodArguments(context.methodName)), so the caller'sargumentscan never reach them; and the strict globalArgs validation (~line 133) rejects any method-arg keys that came along for the ride.design/models.mdshowsarguments: { cidrBlock: "[IP-1]/16" }flowing into acreatemethod, which reads as the intended behavior — so this looks like an implementation gap rather than a design choice (though happy to be corrected!).
Impact for us: every composition we're migrating passes per-call data (prompts, PR lists, browser command batches), so today the runModel path fails validation for all of them. The silver lining: the validation failure fires before the method body runs, so we've shipped our conversions as runModel-first with a cheap fall-back to our old shell-out on that error — zero behavior change now, and the runModel path will light up on its own once argument threading works. So there's no urgency on our end, just wanted to flag it while it's fresh.
Could a fix perhaps thread options.arguments through to the method-args resolution (e.g. merged over definition.getMethodArguments(...) before validation), rather than into globalArgs? Whatever direction you prefer, of course. Happy to test a build against our real extension chain — we have four converted call sites that would exercise it immediately. Thanks so much!
Shipped
Click a lifecycle step above to view its details.
mgreten commented 7/11/2026, 10:53:56 PM
Verified fixed on our real workload — thank you for the fast turnaround! On 20260711.221640.0 our adw-phase-runner → cli-agent chain now runs fully in-process: the child received its prompt method argument correctly (classification completed, 117s), and process-sampling during the run showed zero child swamp-bin processes where the shellout fallback used to spawn one. Our fallback predicates never fired. Exactly the behavior we hoped for — much appreciated!
Sign in to post a ripple.