Skip to content

fix: honor per-task model override in delegate_task#17718

Open
Kailigithub wants to merge 1 commit into
NousResearch:mainfrom
Kailigithub:fix/delegate-task-model-override
Open

fix: honor per-task model override in delegate_task#17718
Kailigithub wants to merge 1 commit into
NousResearch:mainfrom
Kailigithub:fix/delegate-task-model-override

Conversation

@Kailigithub

Copy link
Copy Markdown
Contributor

Summary

The delegate_task tool was silently ignoring the per-task model override field, causing all child subagents to always use the parent's model regardless of per-task specification.

Root Cause

In _build_child_agent() calls within delegate_task(), the model parameter always resolved to creds["model"] (the global delegation model), ignoring any per-task model field. Other per-task fields like role and toolsets correctly used the t.get(...) or global_default pattern.

Fix

Apply the same fallback pattern used for role and toolsets:

# Before (broken):
model=creds["model"],

# After (fixed):
model=t.get("model") or creds["model"],

This allows each task dict in a batch delegation to optionally specify its own model while preserving the default behavior.

Verification

  • python3 -m py_compile tools/delegate_tool.py passes
  • 29 existing subagent/delegate tests pass (tests/agent/test_subagent_*.py, tests/cli/test_cli_interrupt_subagent.py)

Closes #17685

Previously the per-task model field was silently ignored, causing all child subagents to always inherit the parent model regardless of per-task specification.

Now follows the same fallback pattern used for role and toolsets.

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

Labels

P2 Medium — degraded but workaround exists tool/delegate Subagent delegation type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

delegate_task: per-task model override is silently ignored — children always use parent's model

2 participants