feat(delegate): add per-task model override to delegate_task#6771
Open
GusBot69 wants to merge 1 commit into
Open
feat(delegate): add per-task model override to delegate_task#6771GusBot69 wants to merge 1 commit into
GusBot69 wants to merge 1 commit into
Conversation
HughesCuit
approved these changes
Apr 10, 2026
Expose the existing per-child model override capability in the
delegate_task tool schema. The internal _build_child_agent already
accepts a model parameter, but the tool schema doesn't expose it.
Changes:
- Add 'model' field to top-level tool schema properties
- Add 'model' field to per-task items in batch mode
- Thread model through to _build_child_agent via task dict
- Task-level model takes precedence over delegation config
Enables routing different tasks to different models:
delegate_task(goal='debug this', model='modelstudio/qwen3-coder-plus')
delegate_task(tasks=[{'goal': 'code', 'model': 'codex'}, {'goal': 'research', 'model': 'professor'}])
Fully backwards compatible — model is optional, defaults to parent behavior.
Related: NousResearch#5997, NousResearch#492, NousResearch#356
a6e4e7e to
682ac0c
Compare
1 task
This was referenced May 22, 2026
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
Expose the existing per-child model override capability in the
delegate_tasktool schema. The internal_build_child_agentalready accepts amodelparameter (line 279:effective_model = model or parent_agent.model), but the tool schema doesn't expose it — making it impossible for the LLM to route different tasks to different models.Problem
Currently, all subagents inherit the parent's model (or the global
delegation.modelconfig). There's no way to say "use a coding model for this task but a generalist for that task" within a single conversation.The infrastructure exists but isn't wired to the tool schema.
Solution
3 changes in
tools/delegate_tool.py:modelfield to top-level tool propertiesmodelfield to per-task itemst.get("model")through to_build_child_agentwith fallback to delegation configTask-level model takes precedence over delegation config, which takes precedence over parent model.
Usage
Backwards Compatible
modelis optional — defaults to parent behavior when omittedRelated Issues