Skip to content

feat(delegate): add DELEGATION_GUIDANCE to the system prompt - #10269

Closed
MestreY0d4-Uninter wants to merge 1 commit into
NousResearch:mainfrom
MestreY0d4-Uninter:fix/delegation-guidance-pr
Closed

MestreY0d4-Uninter wants to merge 1 commit into
NousResearch:mainfrom
MestreY0d4-Uninter:fix/delegation-guidance-pr

Conversation

@MestreY0d4-Uninter

Copy link
Copy Markdown
Contributor

Summary

  • add DELEGATION_GUIDANCE to the system prompt so the parent agent knows when to use delegate_task
  • inject the guidance only when delegate_task is actually available
  • clarify in TOOL_USE_ENFORCEMENT_GUIDANCE that delegating with delegate_task counts as valid tool use
  • add focused regression tests for guidance content, injection, and non-injection cases

Why

delegate_task was implemented and validated but underused in practice because the system prompt never told the model when delegation was appropriate. Other meta-tools (memory, session_search, skill_manage) already had dedicated guidance blocks; delegation did not.

This change adds a short, conservative guidance block with prospective triggers:

  • multiple independent subtasks
  • 3+ independent tool calls likely needed
  • reasoning-heavy / parallel / context-heavy work
  • avoid delegating trivial single-step tasks

Test plan

  • python3 -m pytest tests/agent/test_delegation_guidance.py tests/agent/test_prompt_builder.py -o "addopts=" -q
  • validated a real Hermes tmux smoke on gpt-5.4 where a complex prompt triggered delegate_task and completed 3 parallel tasks successfully

Notes

@kshitijk4poor

Copy link
Copy Markdown
Contributor

Thanks for the clean PR — this is well-scoped and follows the existing injection pattern correctly.

After reviewing this against the other guidance blocks, we're going to pass on this one. Here's the reasoning:

The existing guidance constants (MEMORY_GUIDANCE, SESSION_SEARCH_GUIDANCE, SKILLS_GUIDANCE) each teach the model non-obvious behaviors it wouldn't infer from the tool schema alone — proactively saving preferences without being asked, searching past sessions when users say "remember when...", checking skills before replying and patching stale ones. These are counterintuitive trigger conditions that the tool description can't convey.

DELEGATION_GUIDANCE doesn't meet that bar. "Use delegate_task when a request breaks into multiple independent subtasks" is already conveyed by the tool's schema description, which explains single vs batch mode, toolsets, context passing, and when to use vs not use it. Models capable of effective agentic work already infer "parallel independent workstreams = delegate" from reading the schema. The "delegating counts as tool use" line in TOOL_USE_ENFORCEMENT_GUIDANCE is similarly redundant — calling any tool is tool use by definition.

The cost side matters too: this text would be sent on every API call, for every user, for the entire session — permanent system prompt growth for a behavioral nudge the model doesn't need.

If delegation ends up genuinely underused in practice, the right fix would be improving the tool schema description itself rather than adding a separate guidance block. Appreciate the contribution though — the pattern matching and test structure were solid.

@MestreY0d4-Uninter
MestreY0d4-Uninter deleted the fix/delegation-guidance-pr branch April 27, 2026 01:42
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.

2 participants