add proxy support for TavilySearchProvider#779
Conversation
There was a problem hiding this comment.
Pull request overview
Adds proxy support to the Tavily web search provider so Tavily requests can be routed through the same configurable proxy mechanism already used by other web tools.
Changes:
- Add
proxysupport toTavilySearchProviderand usecreateHTTPClientwhen executing Tavily requests. - Propagate
WebSearchToolOptions.Proxyinto the Tavily provider duringNewWebSearchToolconstruction. - Add an explicit default value for
Tools.Web.ProxyinDefaultConfig().
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
pkg/tools/web.go |
Plumbs proxy into Tavily provider and uses shared HTTP client creation helper for Tavily requests. |
pkg/config/defaults.go |
Sets default Tools.Web.Proxy value in the default configuration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| provider = &TavilySearchProvider{ | ||
| apiKey: opts.TavilyAPIKey, | ||
| baseURL: opts.TavilyBaseURL, | ||
| proxy: opts.Proxy, | ||
| } |
There was a problem hiding this comment.
New behavior: TavilySearchProvider now accepts/propagates a proxy option, but existing tests only assert proxy propagation for Perplexity/Brave/DuckDuckGo. Add a test case that selects Tavily and asserts the proxy value is set (similar to the other subtests) to prevent regressions.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
nikolasdehor
left a comment
There was a problem hiding this comment.
Looks good — this brings Tavily in line with the Brave provider that already has proxy support via createHTTPClient.
Two minor observations:
-
Config wiring: I see the
Proxyfield added toDefaultConfig()and passed throughopts.Proxy, but I don't see where theTavilySearchProvider.proxyfield gets populated fromWebToolsConfig.Proxyin the constructor path. Is there an existing mapping I'm missing, or does this need a corresponding change in the code that buildsWebSearchToolOptionsfrom the config? -
Brave already uses the shared proxy: Worth confirming that both providers share the same
tools.web.proxyconfig key rather than having separate proxy settings per provider — that seems like the right design.
Otherwise the error handling is correct (wrapping the error from createHTTPClient) and the change is minimal and focused.
|
thanks for the pr |
|
@wgjtyu Adding proxy support for TavilySearchProvider is a practical improvement, especially for users running PicoClaw behind corporate firewalls or restricted networks. We're building a PicoClaw Dev Group on Discord for contributors to connect and collaborate. If you'd like to join, drop an email to |
add proxy support for TavilySearchProvider
📝 Description
🗣️ Type of Change
🤖 AI Code Generation
🔗 Related Issue
📚 Technical Context (Skip for Docs)
🧪 Test Environment
📸 Evidence (Optional)
Click to view Logs/Screenshots
☑️ Checklist