feat(prompt): add concurrency discipline for sub-agent spawning#86
Merged
yishuiliunian merged 1 commit intomainfrom Apr 5, 2026
Merged
feat(prompt): add concurrency discipline for sub-agent spawning#86yishuiliunian merged 1 commit intomainfrom
yishuiliunian merged 1 commit intomainfrom
Conversation
LLM agents could spawn excessive parallel sub-agents on complex tasks, wasting resources and tokens. Rather than hard-coding limits in the runtime, guide the LLM via system prompt to self-regulate concurrency based on task complexity — start small, assess before parallelizing, iterate instead of pre-allocating, and match parallelism to actual task breadth.
yishuiliunian
added a commit
that referenced
this pull request
Apr 6, 2026
…ruct params (#86) Sub-agents had no awareness of their position in the delegation chain, leading to cascading spawns (129 agents from a single task). This change: - Propagates `depth` through the full IPC chain so each agent knows how deep it is (rendered as `{{ agent_depth }}` in system prompt) - Removes the hard `max_depth` limit — depth is informational, not a gate - Adds Delegation Depth guidance in agent-guidelines.md so deeper agents naturally prefer direct tool use over further delegation - Refactors `start_agent()` from 10 positional params to `StartAgentParams` - Removes redundant concurrency guidance from agent-type prompts (explore, plan, default-subagent) — centralized in agent-guidelines.md
yishuiliunian
added a commit
that referenced
this pull request
Apr 6, 2026
* feat(agent): propagate depth via IPC and refactor start_agent into struct params (#86) Sub-agents had no awareness of their position in the delegation chain, leading to cascading spawns (129 agents from a single task). This change: - Propagates `depth` through the full IPC chain so each agent knows how deep it is (rendered as `{{ agent_depth }}` in system prompt) - Removes the hard `max_depth` limit — depth is informational, not a gate - Adds Delegation Depth guidance in agent-guidelines.md so deeper agents naturally prefer direct tool use over further delegation - Refactors `start_agent()` from 10 positional params to `StartAgentParams` - Removes redundant concurrency guidance from agent-type prompts (explore, plan, default-subagent) — centralized in agent-guidelines.md * fix: rustfmt long build_system_prompt call lines
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.
Summary
Changes
crates/loopal-prompt-system/prompts/tools/agent-guidelines.mdTest plan