Skip to content

fix(delegation): respect delegation.model config for subagents (fixes #12440)#18649

Closed
GregChinn wants to merge 1 commit into
NousResearch:mainfrom
GregChinn:fix/delegate-model-inheritance-12440
Closed

fix(delegation): respect delegation.model config for subagents (fixes #12440)#18649
GregChinn wants to merge 1 commit into
NousResearch:mainfrom
GregChinn:fix/delegate-model-inheritance-12440

Conversation

@GregChinn

Copy link
Copy Markdown

Summary

Fixes #12440 - Subagents were ignoring the delegation.model config setting and always inheriting the parent agent's model.

Changes

  • Added delegation_cfg.get("model") to the model resolution chain at lines 946 and 982 in tools/delegate_tool.py
  • Now respects the precedence: explicit model param > delegation.model config > parent agent model

Testing

Manually verified that subagents now use the model specified in delegation.model in config.yaml instead of always inheriting the parent model.

Related

…esearch#12440)

- Add delegation_cfg.get('model') to effective_model resolution at lines 946 and 982
- Subagents now properly inherit the model specified in delegation.model config
- Previously ignored delegation.model, always falling back to parent agent model
- Fixes GitHub issue NousResearch#12440
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/tools Tool registry, model_tools, toolsets tool/delegate Subagent delegation labels May 2, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #12503 — both fix #12440 by adding delegation.model to the model resolution chain in delegate_tool.py.

@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #12503

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the contribution. This behavior is already implemented on current main, so I'm marking this PR as superseded by the existing implementation.

Automated hermes-sweeper review evidence:

  • tools/delegate_tool.py:2479 reads delegation.model into configured_model.
  • tools/delegate_tool.py:2531 returns that configured model even when no separate delegation.provider is set, preserving the same-provider override case.
  • tools/delegate_tool.py:2119 passes creds["model"] into _build_child_agent for spawned subagents.
  • tools/delegate_tool.py:1055 uses that passed model before falling back to parent_agent.model.
  • This was added by 9423fda5cb573ef6b1a7876fc01157433eb7d785 and is contained in v2026.3.12 and later tags.

The prior maintainer comments noting this was likely duplicate work were consistent with the current code.

@teknium1 teknium1 closed this Jun 10, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tools Tool registry, model_tools, toolsets P2 Medium — degraded but workaround exists sweeper:implemented-on-main Sweeper: behavior already present on current main tool/delegate Subagent delegation type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Sub-agent model configuration is ignored, causing persistent context window errors

4 participants