Skip to content

fix(delegate): per-task model and reasoning_effort routing - #48867

Closed
neaucode-bot wants to merge 2 commits into
NousResearch:mainfrom
neaucode-bot:fix/delegate-task-model-forwarding
Closed

fix(delegate): per-task model and reasoning_effort routing#48867
neaucode-bot wants to merge 2 commits into
NousResearch:mainfrom
neaucode-bot:fix/delegate-task-model-forwarding

Conversation

@neaucode-bot

@neaucode-bot neaucode-bot commented Jun 19, 2026

Copy link
Copy Markdown

Summary

  • Forward top-level model and reasoning_effort from delegate_task tool-call args through AIAgent._dispatch_delegate_task to delegate_task().
  • Accept those kwargs in delegate_task() / _build_child_agent() with per-task resolution (task override > top-level > delegation.model / delegation.reasoning_effort > parent inherit).
  • Extend DELEGATE_TASK_SCHEMA and tool description so orchestrators can route individual children to different models/effort levels.
  • Without both halves, orchestrators that pass per-delegation model/effort overrides hit a TypeError at dispatch or silently fall back to config/parent defaults.

Commits

  1. c17dafb9b_dispatch_delegate_task forwarding in run_agent.py
  2. b79a3ed28delegate_task() / _build_child_agent() acceptance + schema/tests

Test plan

  • scripts/run_tests.sh tests/tools/test_delegate.py -- -k "TestDispatchDelegateTask or TestDelegationReasoningEffort or test_schema_has_model" -q (9 passed)
  • test_model_and_reasoning_effort_forwarded — dispatch helper forwards kwargs
  • test_model_and_reasoning_effort_forwarded_to_build_child_agentdelegate_task passes model/effort to _build_child_agent
  • test_per_task_override_reasoning_effort_beats_config — per-task effort beats delegation.reasoning_effort
  • test_schema_has_model_and_reasoning_effort_top_level_and_per_task — schema exposes new fields

…te_task

_dispatch_delegate_task is the single dispatch site for delegate_task tool
calls; top-level model and reasoning_effort from tool args were dropped,
so workers always fell back to delegation.model / parent inheritance.
Add regression test alongside the existing acp_args forwarding check.

Co-authored-by: Cursor <cursoragent@cursor.com>
@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint tool/delegate Subagent delegation P2 Medium — degraded but workaround exists labels Jun 19, 2026
Wire per-task model/effort routing through delegate_task and
_build_child_agent so _dispatch_delegate_task forwarding is end-to-end.
Adds schema fields, per-task resolution in the batch loop, and tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
@neaucode-bot neaucode-bot changed the title fix(delegate): forward model and reasoning_effort in _dispatch_delegate_task fix(delegate): per-task model and reasoning_effort routing Jun 19, 2026

@tonydwb tonydwb 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.

Code Review Summary

Verdict: Approved

Good per-task routing fix. The delegate now properly passes model and reasoning_effort per-task instead of relying on task defaults. No issues.

Looks Good

  • 3 files changed, +145 -10 lines
  • Clean delegation routing fix
  • No test files touched (delegation logic)

Reviewed by Hermes Agent

@neaucode-bot

Copy link
Copy Markdown
Author

Superseded by #52693 (re-opened from the neaucode-org org fork). Closing in favor of that PR.

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

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint 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.

3 participants