fix(tools): add proxy support to web_fetch HTTP transport#447
Closed
nikolasdehor wants to merge 1 commit intosipeed:mainfrom
Closed
fix(tools): add proxy support to web_fetch HTTP transport#447nikolasdehor wants to merge 1 commit intosipeed:mainfrom
nikolasdehor wants to merge 1 commit intosipeed:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where the web_fetch tool ignored proxy environment variables (HTTP_PROXY, HTTPS_PROXY, NO_PROXY). The fix adds a single line to configure the HTTP transport to respect these environment variables, aligning with Go standard library conventions and fixing issue #413.
Changes:
- Added
Proxy: http.ProxyFromEnvironmentto the custom HTTP transport in WebFetchTool.Execute
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The web_fetch tool's custom http.Transport was missing the Proxy field, causing it to ignore HTTP_PROXY/HTTPS_PROXY environment variables. Unlike a nil Transport (which defaults to http.DefaultTransport with ProxyFromEnvironment), a manually constructed Transport defaults Proxy to nil (no proxy). Add Proxy: http.ProxyFromEnvironment to restore proxy support for users behind corporate proxies or in censored networks. Closes sipeed#413
3364e9c to
fcc6c02
Compare
3 tasks
Collaborator
|
I am closing this PR as issue #587 provides a more comprehensive solution to the proxy problem. |
5 tasks
10 tasks
This was referenced Feb 27, 2026
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.
Description
The
web_fetchtool's customhttp.Transportwas missing theProxyfield, causing it to silently ignoreHTTP_PROXY/HTTPS_PROXY/NO_PROXYenvironment variables. This is a one-line fix.Type of change
AI-Generated Code Disclosure
Related Issue
Closes #413
Root Cause
When constructing an
http.Transport{}manually, theProxyfield defaults tonil(no proxy). This is different fromhttp.DefaultTransport, which setsProxy: http.ProxyFromEnvironment.The search providers (Brave, DuckDuckGo, Perplexity) use
&http.Client{Timeout: ...}with a nilTransport, so they correctly inherithttp.DefaultTransportand respect proxy env vars. ButWebFetchTool.Execute()constructs a custom transport (for connection pooling and TLS tuning) that was missing the proxy field.Note on PR #422
PR #422 attempts to fix this same issue but targets the wrong code path — it adds
Transport: http.DefaultTransportto the Brave search provider, which is a no-op since nil Transport already uses DefaultTransport. See my review on #422 for details.Test Environment
Evidence
All existing web tool tests pass:
Self-review checklist