feat(web-search): make Brave Search base URL configurable#1
Open
feat(web-search): make Brave Search base URL configurable#1
Conversation
added 3 commits
March 11, 2026 07:15
Add support for a custom base URL for Brave Search API requests, useful for pointing at a reverse proxy or internal mirror. Changes: - tools.web.search.brave.baseUrl config field (replaces the origin https://api.search.brave.com, path segments are preserved) - BRAVE_BASE_URL env var as an alternative (config takes precedence) - resolveBraveBaseUrl() helper following the same pattern as resolveKimiBaseUrl() - braveBaseUrl threaded through runWebSearch / runBraveLlmContextSearch - Cache key updated to include braveBaseUrl to avoid cross-origin hits Default behaviour is unchanged when neither config nor env var is set.
… remove dead constants - Add providerSpecificKey to the llm-context cache key branch so that requests with different braveBaseUrl values no longer collide. - Remove the now-unused BRAVE_SEARCH_ENDPOINT and BRAVE_LLM_CONTEXT_ENDPOINT constants (dead code since the URL construction switched to path+base form).
Cover config baseUrl, env var fallback, priority (config > env > default), whitespace trimming, and empty env var fallback.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
将 Brave Search API base URL 改为可配置,支持指向反向代理或内部镜像。
改动
tools.web.search.brave.baseUrl配置字段(替换 originhttps://api.search.brave.com)BRAVE_BASE_URL环境变量支持(config 优先级更高)对应 upstream PR: openclaw#42882