← Back to PRs

#18616: agents: add bootstrap retrieval mode to reduce prompt overhead

by Duartemartins open 2026-02-16 22:33 View on GitHub →
agents stale size: M
Adds bootstrap retrieval mode (`off|auto|on`) to reduce prompt overhead by retrieving relevant excerpts instead of injecting full bootstrap files in large workspaces. <!-- greptile_comment --> <h3>Greptile Summary</h3> This PR introduces a bootstrap retrieval mode to optimize prompt size by retrieving relevant excerpts instead of injecting full bootstrap files in large workspaces. - Added `bootstrapRetrieval` configuration with `off|auto|on` modes - Implemented keyword-based scoring system with stopword filtering - Created paragraph-based chunking with configurable size limits - Prioritizes required files (AGENTS.md, SOUL.md, TOOLS.md) in selection - Auto mode triggers when bootstrap content exceeds 12KB threshold - Passes `retrievalPrompt` (user prompt) to scoring function for relevance ranking - Added comprehensive E2E tests covering all three modes - Configuration schema updated with help text and labels <h3>Confidence Score: 4/5</h3> - This PR is safe to merge with minimal risk - The implementation is well-tested with E2E coverage, follows existing patterns, and includes proper fallback behavior. The keyword-based retrieval logic is straightforward and doesn't introduce security concerns. Configuration validation is handled correctly. One minor optimization opportunity exists in required file selection, but it doesn't affect correctness. - No files require special attention <sub>Last reviewed commit: 1d3d65c</sub> <!-- greptile_other_comments_section --> <sub>(4/5) You can add custom instructions or style guidelines for the agent [here](https://app.greptile.com/review/github)!</sub> <!-- /greptile_comment -->

Most Similar PRs