Skip to content

add proxy support for TavilySearchProvider#779

Merged
yinwm merged 2 commits intosipeed:mainfrom
wgjtyu:main
Feb 25, 2026
Merged

add proxy support for TavilySearchProvider#779
yinwm merged 2 commits intosipeed:mainfrom
wgjtyu:main

Conversation

@wgjtyu
Copy link
Contributor

@wgjtyu wgjtyu commented Feb 25, 2026

📝 Description

🗣️ Type of Change

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 📖 Documentation update
  • ⚡ Code refactoring (no functional changes, no api changes)

🤖 AI Code Generation

  • 🤖 Fully AI-generated (100% AI, 0% Human)
  • 🛠️ Mostly AI-generated (AI draft, Human verified/modified)
  • 👨‍💻 Mostly Human-written (Human lead, AI assisted or none)

🔗 Related Issue

📚 Technical Context (Skip for Docs)

  • Reference URL:
  • Reasoning:

🧪 Test Environment

  • Hardware:
  • OS:
  • Model/Provider:
  • Channels:

📸 Evidence (Optional)

Click to view Logs/Screenshots

☑️ Checklist

  • My code/docs follow the style of this project.
  • I have performed a self-review of my own changes.
  • I have updated the documentation accordingly.

Copilot AI review requested due to automatic review settings February 25, 2026 14:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 proxy support to TavilySearchProvider and use createHTTPClient when executing Tavily requests.
  • Propagate WebSearchToolOptions.Proxy into the Tavily provider during NewWebSearchTool construction.
  • Add an explicit default value for Tools.Web.Proxy in DefaultConfig().

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.

Comment on lines 424 to 428
provider = &TavilySearchProvider{
apiKey: opts.TavilyAPIKey,
baseURL: opts.TavilyBaseURL,
proxy: opts.Proxy,
}
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 25, 2026 15:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link

@nikolasdehor nikolasdehor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good — this brings Tavily in line with the Brave provider that already has proxy support via createHTTPClient.

Two minor observations:

  1. Config wiring: I see the Proxy field added to DefaultConfig() and passed through opts.Proxy, but I don't see where the TavilySearchProvider.proxy field gets populated from WebToolsConfig.Proxy in the constructor path. Is there an existing mapping I'm missing, or does this need a corresponding change in the code that builds WebSearchToolOptions from the config?

  2. Brave already uses the shared proxy: Worth confirming that both providers share the same tools.web.proxy config 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.

Copy link
Collaborator

@yinwm yinwm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yinwm
Copy link
Collaborator

yinwm commented Feb 25, 2026

thanks for the pr

@yinwm yinwm merged commit 094d659 into sipeed:main Feb 25, 2026
5 of 6 checks passed
@Orgmar
Copy link
Contributor

Orgmar commented Feb 27, 2026

@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 support@sipeed.com with the subject [Join PicoClaw Dev Group] wgjtyu and we'll send you the invite link.

hyperwd pushed a commit to hyperwd/picoclaw that referenced this pull request Mar 5, 2026
add proxy support for TavilySearchProvider
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants