← Back to PRs

#19314: feat: add Brave web_search baseUrl override (AI-assisted)

by mrutunjay-kinagi open 2026-02-17 17:30 View on GitHub →
docs agents size: M
## Summary - add `tools.web.search.baseUrl` for Brave web_search provider - route Brave requests to the configured base URL (default remains `https://api.search.brave.com`) - support both base host (`https://proxy/brave`) and full endpoint (`.../res/v1/web/search`) forms - include Brave base URL in cache key to avoid cross-endpoint cache collisions - update config schemas/types/help text and docs (EN + zh-CN) - add tests for Brave base URL resolver and request URL behavior Closes #19075 ## Testing - Degree of testing: fully tested (targeted) - Ran: `corepack pnpm vitest run --config vitest.e2e.config.ts src/agents/tools/web-search.e2e.test.ts src/agents/tools/web-tools.enabled-defaults.e2e.test.ts` - Ran: `corepack pnpm vitest run src/config/config.env-vars.test.ts` - Result: all targeted tests passed (58 tests across 3 files) ## AI Assistance - This PR was AI-assisted via Codex. <!-- greptile_comment --> <h3>Greptile Summary</h3> added `baseUrl` config option for Brave web_search provider to support proxies and self-hosted routing - includes Brave base URL in cache key to prevent cross-endpoint collisions - supports both base host form (`https://proxy/brave`) and full endpoint form (`...res/v1/web/search`) - updated config schemas, types, help text, and docs (EN + zh-CN) - added comprehensive tests for URL resolution and caching behavior <h3>Confidence Score: 4/5</h3> - safe to merge after fixing the edge case bug in endpoint resolution - well-tested feature addition with comprehensive test coverage, but contains one logical bug where invalid baseUrl input (path-only without protocol/host) could cause runtime errors - src/agents/tools/web-search.ts line 203 needs the logical fix before merging <sub>Last reviewed commit: c83b5d6</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