Repository navigation
Description
Description
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
webfetchto google.com →Transport errorwebfetchto bing.com → works- TUN mode proxy (network-level) → works, proving the issue is at the application proxy awareness level
- Explicit
HTTPS_PROXYenv 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_PROXYbefore 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_PROXYas 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_PROXYis set
Activity
github-actions commentedon May 16, 2026
This issue might be a duplicate of existing issues. Please check:
opencode.jsonwith nearly identical proposed config structureIf 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 commentedon 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 commentedon 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:webfetchtoolImplementation approach — create a proxy-aware
fetchwrapper and inject it into theFetchHttpClientservice + provider options. The existingproxy-env.tsalready readsHTTP_PROXY/HTTPS_PROXYfor WebSockets, so the foundation is there.I'd keep it minimal:
proxy.url+proxy.noProxyinopencode.json, fallback to env vars. SOCKS5 viasocks-proxy-agent(optional dep). No UI changes — just config.Want me to submit a PR?
coinsoundsbetter commentedon 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:
Directand manual HTTP/HTTPS proxy modes;HttpsProxyAgentfor 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:
Use environment proxy,Direct, andManual proxymodes?NO_PROXYrules and proxy authentication be included in the first PR, or follow separately?I am happy to prepare a focused PR with tests and link it to this issue.
TCXM commentedon 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 commentedon 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
webfetchand 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_PROXYenvironment variables and does not read the Windows system proxy settings. So the workarounds you listed (settingHTTPS_PROXYas 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:
opencode.json(the config part of this request)HTTPS_PROXYdoes not work in v2