← Back to PRs

#14432: System prompt: add guidance for spawning background sub-agents

by vignesh07 open 2026-02-12 04:12 View on GitHub →
agents maintainer size: XS
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