fix(delegate): reduce subagent system prompt bloat - #42822
Conversation
… toolset and guidance (fixes NousResearch#42809)
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Clean, well-scoped fix that reduces system prompt bloat for subagents by:
- Skipping
TASK_COMPLETION_GUIDANCEand tool-specific guidance (memory,session_search,skill_manage) when_delegate_depth > 0 - Adding
skillsto the blocked toolsets list for delegated tasks
Looks Good
- Clear variable name (
is_subagent) with inline comment explaining the intent - Guard is placed at the right level — avoids redundant checks once
is_subagentis set - No test changes needed; behavior is additive (subagents receive less prompting, main agent unchanged)
Minor Note
- PR title could be
fix(delegate): reduce subagent system prompt bloatto match thefix(scope): descriptionconvention used elsewhere in the repo
Reviewed by Hermes Agent
|
Thanks for the PR! A few observations: Overlap with #42831: This PR and #42831 both add "skills" to Worth coordinating with the #42831 author to avoid merge conflicts if both land. Since this PR is a superset, it might make sense to close #42831 in favor of this one if the system_prompt.py changes are wanted. The |
|
We've closed #42831 in favour of this PR it supersedes ours with the broader fix. Thanks for picking it up! |
Related: #42809 (the issue), #42831 (narrower delegate_tool-only fix, now closed in favour of this), #42823 (earlier closed twin of #42831), #48454 (sub-agent context-injection, different mechanism). This PR is the broader fix: it both strips the |
|
Thanks for addressing the real delegated-prompt bloat; current main still inherits the parent skills toolset into children ( Problems
Suggested changes
Automated hermes-sweeper review. |
|
Thanks @Morad37 for flagging the subagent prompt-bloat problem — great catch on issue #42809. The core fix (blocking skills tools from leaf subagents) has been salvaged into #76081 with regression tests and per-tool blocking, and you're credited as the original contributor there. Closing this in favor of that implementation; the broader system-prompt gating was intentionally left out of the salvage's scope. |
Fixes #42809