GeezerVison is showing github.com — [Desktop][Windows] webfetch tool does not respect system proxy settings — feature request: add proxy config in settings UI · Issue #27892 · anomalyco/opencode
[Desktop][Windows] webfetch tool does not respect system proxy settings — feature request: add proxy config in settings UI #27892DescriptionDescription
OpenCode Desktop on Windows does not respect the system proxy settings for the agent's built-in webfetch tool (and likely other HTTP calls made by the agent runtime). This is similar to #26629 but focused on the agent's web fetching capability rather than GitHub Copilot OAuth.
What happened
When using OpenCode Desktop with a Windows system proxy (set via Windows Settings → Network & Internet → Proxy, or through tools like v2rayN in system proxy mode), the agent's webfetch tool cannot access websites behind the GFW (e.g., google.com, reddit.com). It works for sites accessible from China (e.g., bing.com, baidu.com), confirming the requests go direct without passing through the system proxy.
Expected behavior
The agent's webfetch tool (and all outbound HTTP calls from the agent runtime) should respect the Windows system proxy configuration, just like a regular browser or any proxy-aware application would.
Actual behavior
webfetch to google.com → Transport error
webfetch to bing.com → works
- TUN mode proxy (network-level) → works, proving the issue is at the application proxy awareness level
- Explicit
HTTPS_PROXY env var (set before launching) → works, per docs
Environment
- OS: Windows
- App: OpenCode Desktop (GUI app)
- Proxy: v2rayN in system proxy mode, Clash in system proxy mode
- Network: behind GFW (China mainland)
Root cause analysis
The desktop app relies on Node.js's fetch implementation which only respects the HTTP_PROXY/HTTPS_PROXY environment variables. On Windows, there is no native mechanism for Electron/Node.js apps to automatically pick up the system proxy settings (the settings configured via Windows Settings → Network & Internet → Proxy). This means:
- If the user sets
HTTPS_PROXY before launching the app from terminal → works
- If the user clicks the desktop app icon (no env vars) → broken
- If the user uses TUN mode at network level → works (bypasses the issue entirely)
Suggested fix
Add a proxy configuration section in the desktop app settings UI that allows users to:
- Configure an HTTP/HTTPS proxy address and port
- Set proxy bypass rules (NO_PROXY equivalent)
- Optionally set proxy authentication credentials
This would be exposed in the opencode.json config as a proxy field, e.g.:
{
"proxy": {
"http": "http://127.0.0.1:7890",
"https": "http://127.0.0.1:7890",
"noProxy": "localhost,127.0.0.1,::1"
}
}
Workaround
Users currently must either:
- Set
HTTPS_PROXY as a system environment variable and restart the desktop app
- Use a TUN/VPN mode proxy that routes traffic at the network level
- Launch the desktop app from a terminal where
$env:HTTPS_PROXY is set
Reacted by 21hook, XieB, 145a, Artyom Ezri, Jeremy and Dominic Gebhart Activitygithub-actions commented on May 16, 2026 This issue might be a duplicate of existing issues. Please check:
If your issue is specifically about the Windows desktop app not reading system proxy settings (as opposed to missing config-file support), it may still be distinct — please clarify if that's the case. Thundercup commented on May 16, 2026 Thanks for the triage. This issue is distinct from #24981, #18193, and #531 because:
The core problem is that the desktop app does not read the Windows system proxy settings. Those other issues request adding a config-file-based proxy option — which would also work, but is a workaround, not a fix for the root cause.
A native Windows desktop app should respect the proxy settings configured in Windows (Settings → Network & Internet → Proxy), which is the standard mechanism on this platform. Currently the app only respects \HTTPS_PROXY\ env vars, which most desktop users don't set because they expect the system-level proxy to work.
The suggested proxy config UI is a secondary feature request — useful, but the primary bug is: system proxy is ignored.
This is similar to #26629 but broader in scope (not limited to GitHub Copilot OAuth — it affects the agent's \webfetch\ tool and all outbound HTTP calls). 0x80x commented on Jul 15, 2026 I'd like to work on implementing this. A few things I'd add to the scope:
-
SOCKS5 support — not just HTTP/HTTPS proxy. Many users (including myself behind restricted networks) use SOCKS5 proxies. There's a closed issue [FEATURE]:add socks5 proxy #12650 requesting this.
-
All outbound paths — not just webfetch. The proxy config should apply to:
- LLM API calls (AI SDK providers + native runtime)
- WebSocket connections (OpenAI Responses API)
webfetch tool
- Config fetching
- MCP server child processes (pass env vars)
-
Implementation approach — create a proxy-aware fetch wrapper and inject it into the FetchHttpClient service + provider options. The existing proxy-env.ts already reads HTTP_PROXY/HTTPS_PROXY for WebSockets, so the foundation is there.
I'd keep it minimal: proxy.url + proxy.noProxy in opencode.json, fallback to env vars. SOCKS5 via socks-proxy-agent (optional dep). No UI changes — just config.
Want me to submit a PR? Reacted by anti37, Fang Han and Artyom Ezri coinsoundsbetter commented on Aug 28, 2026 Hi! I can reproduce this on Windows Desktop when using a local HTTP proxy in system-proxy mode. The Electron UI may have access to the network, but the local Node sidecar that performs model, webfetch, and OpenAI Responses WebSocket requests does not automatically use that proxy.
I built and verified a local proof of concept with:
- a Desktop Settings UI for
Direct and manual HTTP/HTTPS proxy modes;
- persisted proxy settings;
- applying the selected proxy to the local sidecar's HTTP/fetch requests;
- updating the sidecar at runtime when the setting changes;
- using
HttpsProxyAgent for OpenAI Responses WebSocket connections as well.
The manual configuration uses a URL such as http://127.0.0.1:7890. It is intended as a reliable first step for users whose system-proxy/PAC configuration is not automatically available to the Node sidecar.
Before I prepare a PR, would this scope align with the desired direction? In particular, I would appreciate guidance on:
- Should the initial UI support
Use environment proxy, Direct, and Manual proxy modes?
- Should configurable
NO_PROXY rules and proxy authentication be included in the first PR, or follow separately?
- Is there a preferred Desktop settings storage/API pattern for this feature?
I am happy to prepare a focused PR with tests and link it to this issue. TCXM commented on Oct 7, 2026 Is this still planned for V2? I'd like to work on honoring system proxy settings for the local Desktop sidecar, without adding settings UI. Is anyone actively working on this, and which branch should a PR target? opencodejr commented on Oct 29, 2026 Thanks for the detailed write-up, @Thundercup!
To restate the request: OpenCode Desktop on Windows should use the Windows system proxy (Settings → Network & Internet → Proxy, as set by v2rayN or Clash in system-proxy mode) for everything the agent sends out, including webfetch and model requests. As a second step, there could be a proxy setting in the Settings UI / opencode.json.
I checked how the current version (v2) works. Desktop picks up a proxy only from the HTTP_PROXY / HTTPS_PROXY / NO_PROXY environment variables and does not read the Windows system proxy settings. So the workarounds you listed (setting HTTPS_PROXY as a system environment variable, or using TUN mode) are still the way to go for now. Maintainers will consider adding support for this.
Related issues:
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|