fix(delegate): strip skills toolset from leaf subagents - #42823
Closed
Nullstate-Studio wants to merge 1 commit into
Closed
fix(delegate): strip skills toolset from leaf subagents#42823Nullstate-Studio wants to merge 1 commit into
Nullstate-Studio wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds
"skills"to_strip_blocked_tools()indelegate_tool.pyso 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_toolsetscontrol which tools a subagent loads. The"skills"toolset bringsskill_view,skill_manage, andskills_list— management tools a focused subagent doesn't need. When these tools aren't in the child's toolset,system_prompt.py:185-201skips building the<available_skills>index entirely, saving ~2,800 tokens per subagent before its first API call.Changes
tools/delegate_tool.py"skills"toblocked_toolset_namesin_strip_blocked_tools()tests/tools/test_delegate.py"skills"tests/tools/test_delegate_toolset_scope.py"skills"to input + assertionVerification
All 4 logic paths tested against the actual function extracted from source:
Fixes #42809