Skip to content

fix(delegate): strip skills toolset from leaf subagents - #42823

Closed
Nullstate-Studio wants to merge 1 commit into
NousResearch:mainfrom
Nullstate-Studio:main
Closed

fix(delegate): strip skills toolset from leaf subagents#42823
Nullstate-Studio wants to merge 1 commit into
NousResearch:mainfrom
Nullstate-Studio:main

Conversation

@Nullstate-Studio

Copy link
Copy Markdown

Description

Adds "skills" to _strip_blocked_tools() in delegate_tool.py so leaf subagents don't inherit the skills toolset. Without this, the <available_skills> block (~2,800 tokens for a typical install with ~115 skills) is injected into every child agent's system prompt, causing false context-overflow errors on models with tighter real context windows.

The enabled_toolsets control which tools a subagent loads. The "skills" toolset brings skill_view, skill_manage, and skills_list — management tools a focused subagent doesn't need. When these tools aren't in the child's toolset, system_prompt.py:185-201 skips building the <available_skills> index entirely, saving ~2,800 tokens per subagent before its first API call.

Changes

File Change
tools/delegate_tool.py Add "skills" to blocked_toolset_names in _strip_blocked_tools()
tests/tools/test_delegate.py Update test input to include "skills"
tests/tools/test_delegate_toolset_scope.py Add "skills" to input + assertion

Verification

All 4 logic paths tested against the actual function extracted from source:

  • Skills removed from mixed toolset ✅
  • All blocked toolsets removed ✅
  • Empty input returns empty ✅
  • Allowed toolsets preserved ✅

Fixes #42809

Add 'skills' to _strip_blocked_tools() so leaf subagents don't inherit
the skills toolset, which triggers the ~2,800 token <available_skills>
block in the system prompt. This prevents false context-overflow errors
on models with tighter real context windows than configured.

Fixes #42809
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.

delegate_task: subagent system prompt includes unnecessary bloat causing false context-overflow errors

1 participant