← Back to PRs

#16413: feat(web-search): request and merge Brave extra_snippets

by ciberponk open 2026-02-14 18:42 View on GitHub →
agents size: S
## Summary - feat(web-search): request and merge Brave extra_snippets - Split from our `v2026.2.13` patch train as a single-purpose change for easier review. ## Why - Keep the diff focused and low-risk so it can be merged or reverted independently. ## Scope - Branch: `feat/brave-extra-snippets-lite-en` - Files changed: 2 - Key files: - `src/agents/tools/web-search.ts` - `src/agents/tools/web-tools.enabled-defaults.e2e.test.ts` ## Test Plan - Suggested local command: - `./node_modules/.bin/vitest run src/agents/tools/web-tools.enabled-defaults.e2e.test.ts` - Validation status: - [ ] CI checks pass - [ ] Maintainer re-ran local tests ## Risk & Rollback - Risk: low to medium; impact limited to touched module(s). - Rollback: revert this PR commit(s) cleanly. ## Co-authorship - Co-authored by @ciberponk and Codex (GPT-5). <!-- greptile_comment --> <h3>Greptile Summary</h3> This PR adds support for Brave Search API `extra_snippets` parameter to enhance search result descriptions with additional context. **Changes:** - Added `extra_snippets?: string[]` field to `BraveSearchResult` type - Enabled `extra_snippets=true` parameter in all Brave API requests - Merged extra snippets into result descriptions by concatenating with newlines - Added comprehensive test coverage for the new functionality The implementation is clean and defensive - it filters out non-string values, trims whitespace, and removes empty snippets before joining. This provides richer search results without breaking existing functionality. <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk - The changes are well-contained, defensive, and thoroughly tested. The implementation handles edge cases (non-string values, empty snippets), the API parameter is backward-compatible (Brave API ignores unknown params), and comprehensive tests verify both parameter passing and data merging behavior. No breaking changes or security concerns. - No files require special attention <sub>Last reviewed commit: c94ec5f</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs