Skip to content

feat(delegate): remove model-facing toolsets arg — subagents inherit parent's - #332

Merged
hashbender merged 1 commit into
mainfrom
mirror/pr-56386
Jul 1, 2026
Merged

feat(delegate): remove model-facing toolsets arg — subagents inherit parent's#332
hashbender merged 1 commit into
mainfrom
mirror/pr-56386

Conversation

@hashbender

Copy link
Copy Markdown
Owner

Summary

The model can no longer choose which toolsets a subagent gets — subagents always inherit the parent's enabled toolsets.

delegate_task exposed a model-controllable toolsets arg (top-level and per-task) that let the model select the subagent's capability set. Toolset selection is a capability-scoping decision the model shouldn't make; the parent's toolset is the authoritative floor.

Changes

  • tools/delegate_tool.py: remove toolsets from the delegate_task() signature, the registry handler, and both JSON schema blocks (top-level + per-task). Single-task and per-task child builds pass toolsets=None → pure parent inheritance. Drop the now-dead _SUBAGENT_TOOLSETS / _TOOLSET_LIST_STR schema-hint block.
  • run_agent.py: _dispatch_delegate_task (the live model path) no longer forwards toolsets — it did on every delegation, so this is the load-bearing removal.
  • _build_child_agent keeps its internal toolsets param + intersection helpers (internal API, fed only the inherited value).
  • Tests: schema assertions flipped to assertNotIn; new regression test proves the dispatch path never forwards a smuggled model toolsets.
  • Docs: update delegate_task signature references in the autonomous-ai-agents skill (+ built docs, en/zh).

Validation

Before After
Model-facing toolsets in schema yes (top-level + per-task) removed
Subagent toolset source model choice, else inherit always inherit parent
delegate_task(toolsets=...) accepted TypeError
tests/tools/test_delegate.py + test_async_delegation.py 171 passed

Targeted tests green (171/171). E2E verified with real imports: static + dynamic schema clean, public signature rejects toolsets, internal inheritance machinery intact.

Infographic

infographic


Mirror-of: NousResearch#56386
NousResearch#56386

@tenki-reviewer

tenki-reviewer Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Complete
No issues found!

Risk: 🟡 Medium (40/100) — no findings · 281 LOC across 7 files


PR #332 removes the toolsets parameter from delegate_task() but missed updating two in-code references: the function docstring and the model-facing dynamic schema descriptions in tools/delegate_tool.py. Both still tell callers and the model that toolsets is accepted, creating a documentation-code mismatch.

Files Reviewed (7 files)
run_agent.py
skills/autonomous-ai-agents/hermes-agent/SKILL.md
tests/tools/test_async_delegation.py
tests/tools/test_delegate.py
tools/delegate_tool.py
website/docs/user-guide/skills/bundled/autonomous-ai-agents/autonomous-ai-agents-hermes-agent.md
website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/bundled/autonomous-ai-agents/autonomous-ai-agents-hermes-agent.md

@hashbender
hashbender merged commit f61df42 into main Jul 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant