Skip to content

feat(delegate): add per-task model override to delegate_task - #6771

Closed
GusBot69 wants to merge 1 commit into
NousResearch:mainfrom
GusBot69:feat/delegate-per-task-model-override
Closed

feat(delegate): add per-task model override to delegate_task#6771
GusBot69 wants to merge 1 commit into
NousResearch:mainfrom
GusBot69:feat/delegate-per-task-model-override

Conversation

@GusBot69

@GusBot69 GusBot69 commented Apr 9, 2026

Copy link
Copy Markdown

Summary

Expose the existing per-child model override capability in the delegate_task tool schema. The internal _build_child_agent already accepts a model parameter (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.model config). 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:

  1. Schema: Add model field to top-level tool properties
  2. Batch schema: Add model field to per-task items
  3. Wiring: Thread t.get("model") through to _build_child_agent with fallback to delegation config

Task-level model takes precedence over delegation config, which takes precedence over parent model.

Usage

# Route coding task to coding specialist
delegate_task(
    goal="Debug this function",
    model="modelstudio/qwen3-coder-plus",
    context="..."
)

# Batch with different models per task
delegate_task(
    tasks=[
        {"goal": "Write unit tests", "model": "modelstudio/qwen3-coder-plus"},
        {"goal": "Review docs", "model": "modelstudio/qwen3.5-plus"},
    ]
)

Backwards Compatible

  • model is optional — defaults to parent behavior when omitted
  • No config migration needed
  • Existing delegation behavior unchanged when model is not specified
  • All 64 existing delegate tests pass

Related Issues

@HughesCuit HughesCuit left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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
@GusBot69
GusBot69 force-pushed the feat/delegate-per-task-model-override branch from a6e4e7e to 682ac0c Compare April 19, 2026 03:27
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have tool/delegate Subagent delegation labels Apr 29, 2026
@GEFNENEN

Copy link
Copy Markdown

Nice addition — exposing per-task model makes sense.

One follow-up I’d strongly suggest: please expose reasoning_effort in delegate_task as well, not just model.

Right now the child-agent path already has reasoning support via delegation.reasoning_effort and parent inheritance, so the underlying capability exists. But the tool schema only exposes model, which means the LLM can choose which model to route a child to, but not how much reasoning that child should use on a per-call / per-task basis.

That creates an asymmetry in the delegation surface. In practice, these two knobs usually want to travel together:

  • use a cheaper / faster model and
  • lower or disable reasoning for simple tasks
  • use a stronger model and
  • raise reasoning for hard debugging / synthesis tasks

Suggested shape:

  • add top-level reasoning_effort to delegate_task
  • add per-task reasoning_effort inside tasks[]
  • apply precedence like:
    task.reasoning_effort > top-level reasoning_effort > delegation.reasoning_effort > parent inherit

That would keep this backward-compatible while making delegation routing much more complete and consistent with the existing child-agent implementation.

@teknium1

teknium1 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

We do not want this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have tool/delegate Subagent delegation type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants