#19084: fix: Brave Search baseUrl and Inter-session Message Role
agents
size: XS
Cluster:
Web Search Provider Enhancements
This PR addresses two issues:\n\n1. Adds 'baseUrl' support for the Brave Search provider, allowing users to route search requests through proxies or custom endpoints (#19075).\n2. Fixes an issue where inter-session messages (sent via sessions_send) were incorrectly attributed to the 'user' role instead of 'assistant' (#19049).
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
This PR adds `baseUrl` support for Brave Search to enable routing through proxies/custom endpoints, and fixes inter-session message role attribution.
**Key changes:**
- Added `braveBaseUrl` configuration option in `types.tools.ts` and properly threaded it through the web search implementation
- Updated cache key generation to include `braveBaseUrl` to prevent cache collisions between different endpoints
- Fixed inter-session messages (sent via `sessions_send`) to be correctly attributed to "assistant" role instead of "user" role
The changes are well-structured and follow the existing patterns in the codebase. The Brave baseUrl implementation mirrors the existing Perplexity baseUrl support, and the message role fix correctly handles inter-session communication.
<h3>Confidence Score: 4/5</h3>
- This PR is safe to merge with low risk
- The changes are straightforward and follow established patterns in the codebase. Both features (Brave baseUrl support and inter-session message role fix) are isolated, well-implemented, and address real issues. The cache key update prevents potential bugs from endpoint mixing. No security concerns or breaking changes identified.
- No files require special attention
<sub>Last reviewed commit: 171118d</sub>
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#19314: feat: add Brave web_search baseUrl override (AI-assisted)
by mrutunjay-kinagi · 2026-02-17
85.2%
#19126: feat(web-search): add baseUrl option for Brave Search provider
by pierreeurope · 2026-02-17
83.0%
#13843: feat(web-search): allow overriding Brave Search base URL
by strelov1 · 2026-02-11
82.7%
#18167: feat(web-search): add baseUrl support for Brave Search provider
by jkoprax · 2026-02-16
82.6%
#22505: Feature/clean grok search base url
by vacuityv · 2026-02-21
78.5%
#8715: fix(web-search): safer provider resolution & Perplexity auto-detection
by abhijeet117 · 2026-02-04
77.8%
#17729: fix(configure): update web tools hint to reflect all search providers
by raktim-mondol · 2026-02-16
74.0%
#19042: Security: add URL allowlist for web_search and web_fetch
by smartprogrammer93 · 2026-02-17
74.0%
#13370: Tools: rewrite Grok parser, add Tavily provider, multi-provider con...
by a-anand-91119 · 2026-02-10
73.8%
#19031: fix(web-search): normalize ui_lang parameter for Brave Search API
by moxunjinmu · 2026-02-17
73.6%