feat: add model parameter to Task tool for dynamic subagent model selection#14961
feat: add model parameter to Task tool for dynamic subagent model selection#14961albahrani wants to merge 1 commit intoanomalyco:devfrom
Conversation
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found the following potentially related PRs: Related PRs:
These PRs appear to be related efforts in enabling dynamic subagent configuration. You may want to review them to ensure there's no overlap in implementation or to see if this PR should be coordinated with existing variant/model selection mechanisms. |
|
Thanks for flagging the related PRs. Here's how this one fits in:
This PR is intentionally minimal (9 lines, 2 files) to provide the foundational mechanism. It doesn't conflict with any of the above and could serve as a building block for #11377's tier resolution. |
Issue for this PR
Closes #6651
Type of change
What does this PR do?
Adds an optional
modelparameter to the Task tool so callers can specify which model a subagent runs on at invocation time, instead of relying solely on static agent config or parent session fallback.The resolution order becomes:
params.model>agent.model> parent session model. Existing behavior is unchanged when the parameter is omitted.This is needed for orchestrator workflows (e.g. gsd-opencode) where different subagents should use different model tiers based on their role, determined dynamically at call time.
How did you verify your code works?
Built from source on Windows, replaced the installed binary, and tested three scenarios:
modelparamgithub-copilot/claude-haiku-4.5github-copilot/claude-sonnet-4.6Verified by spawning subagents and checking the model ID in their system prompt.
Screenshots / recordings
Not a UI change.
Checklist