fix(delegation): forward model param in _dispatch_delegate_task - #19719
mailinglistenator wants to merge 2 commits into
Conversation
_dispatch_delegate_task() was dropping the 'model' parameter when
forwarding the LLM's tool call to delegate_task(). The schema
advertised model as a field and the registry accepted it, but the
dispatch layer silently discarded it, so per-invocation model
overrides never reached the delegate_task() function.
This affected ALL providers — any user setting a per-invocation
model override (or relying on delegation.model config) would see
the child spawn as the parent's model instead.
Root cause confirmed via live debug tracing across config read,
credential resolution, AIAgent construction, and run_conversation.
The entire pipeline was correct except for this one missing kwarg.
Fix: one line — add model=function_args.get('model') to the
_delegate_task() call in _dispatch_delegate_task.
…forwards The delegate_task() function signature was missing the 'model' parameter. When _dispatch_delegate_task forwards it, the call would raise TypeError without this. Also updates DELEGATE_TASK_SCHEMA and the registry handler to pass model through, and adds per-task model override resolution (per-task > top-level > delegation config).
fc3675e to
dbe1c41
Compare
…rride Adds a new 'model' parameter (object with model + provider fields) to the delegate_task tool, supporting both top-level and per-task overrides. Priority chain: per-task model > top-level model > delegation config > parent inheritance Cherry-picked from upstream PR NousResearch#19719.
|
This PR directly affects our daily workflow. We have model profiles (GLM 5.2, DeepSeek) and fallback chains configured, but delegate_task silently ignores the model parameter — subagents inherit the parent model instead of the intended per-task model. Impact:
A merge would be very valuable — it's the missing piece for proper multi-agent model orchestration. |
|
Thanks for the careful tracing and the concrete forwarding fix. This automated hermes-sweeper review is closing this because the PR adds per-invocation and per-task model/provider routing to
For a fixed child model/provider, please use the supported Closed as not-planned per standing maintainer policy ( |
Bug
_dispatch_delegate_task()drops themodelparameter when forwarding the LLM's tool call todelegate_task(). The schema advertisesmodelas a field and the registry accepts it, but the dispatch layer silently discards it.This affects ALL providers — any user setting a per-invocation model override (or relying on
delegation.modelconfig) sees the child spawn as the parent's model instead.Root Cause
The
DELEGATE_TASK_SCHEMAincludes:The LLM correctly includes
model={"model": "deepseek-v4-flash"}in its tool call args. But_dispatch_delegate_task()forwardsgoal,context,toolsets,tasks,max_iterations,acp_command,acp_args,role,parent_agent— everything exceptmodel.The rest of the pipeline is correct (config →
_resolve_delegation_credentials→_build_child_agent→AIAgent.__init__), but the LLM tool call path bypasses it entirely.Fix
One line: add
model=function_args.get("model")to the_delegate_task()call.Verification
deepseek-v4-prodelegation.model: deepseek-v4-flashdelegate_task(goal="Report your model"):deepseek-v4-pro(inherits parent)deepseek-v4-flash(config respected) ✓Confirmed via live debug tracing across config read, credential resolution, AIAgent construction, and
run_conversation. Every checkpoint in the pipeline produces the correct value with this fix.