#14432: System prompt: add guidance for spawning background sub-agents
agents
maintainer
size: XS
Cluster:
Session Management Enhancements
Adds concrete system-prompt guidance for when to use sessions_spawn (background sub-agents), plus a small unit test covering the new section.
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates the generated agent system prompt to include more concrete guidance on when to spawn background sub-agents (via `sessions_spawn`), and adds a unit test asserting the new section is present.
The change lives in `src/agents/system-prompt.ts` within the Tooling section, which is included in full prompts produced by `buildAgentSystemPrompt`; the test in `src/agents/system-prompt.test.ts` exercises that the new guidance text is emitted.
<h3>Confidence Score: 4/5</h3>
- Mostly safe to merge, but the prompt currently references a tool that may not be enabled in a given session.
- Changes are localized to prompt text and a small test. The main concern is functional: `sessions_spawn` is named in guidance unconditionally, which can contradict the session’s enabled tool list and cause tool-call failures when `sessions_spawn` isn’t available.
- src/agents/system-prompt.ts
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#14734: test(agents): guard against stale allowAgents in existing sessions
by davidahmann · 2026-02-12
78.7%
#14701: Agent: enforce execute-first replies and clarify whisper modes
by Swader · 2026-02-12
78.1%
#13990: feat: add subagent_progress tool for sub-agent progress reporting
by caprihan · 2026-02-11
77.4%
#20072: feat(sessions_spawn): add sessionKey param to reuse sub-agent sessions
by Be1Human · 2026-02-18
77.2%
#9273: Add files via upload
by cyrilliu1974 · 2026-02-05
77.2%
#16247: feat(agents): declarative agent definitions for sessions_spawn
by zerone0x · 2026-02-14
76.4%
#10748: feat: Add sessions.spawn gateway method for direct subagent spawning
by fox-openclaw · 2026-02-06
76.0%
#7525: Agents: skip errored tool calls during pairing
by justinhuangcode · 2026-02-02
75.8%
#7983: feat(security): add secure coding guidelines to system prompt
by TGambit65 · 2026-02-03
75.5%
#17788: fix: correct config path in sessions_spawn error hint (v2)
by Limitless2023 · 2026-02-16
75.4%