Skip to content

feat(prompt): add concurrency discipline for sub-agent spawning#86

Merged
yishuiliunian merged 1 commit intomainfrom
feat/agent-concurrency-guidance
Apr 5, 2026
Merged

feat(prompt): add concurrency discipline for sub-agent spawning#86
yishuiliunian merged 1 commit intomainfrom
feat/agent-concurrency-guidance

Conversation

@yishuiliunian
Copy link
Copy Markdown
Contributor

Summary

  • Add Concurrency Discipline section to the Agent Guidelines system prompt to guide LLM agents toward responsible sub-agent spawning
  • Replace the previous "launch multiple agents simultaneously for maximum efficiency" encouragement with principle-based guidance: start small, assess before parallelizing, iterate don't pre-allocate
  • No hard runtime limits — the LLM decides concurrency based on actual task complexity

Changes

  • crates/loopal-prompt-system/prompts/tools/agent-guidelines.md

Test plan

  • CI passes (prompt-only change, no code impact)

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 yishuiliunian merged commit 2a4e69b into main Apr 5, 2026
3 checks passed
@yishuiliunian yishuiliunian deleted the feat/agent-concurrency-guidance branch April 5, 2026 15:10
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
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.

1 participant