Skip to content

[Desktop][Windows] webfetch tool does not respect system proxy settings — feature request: add proxy config in settings UI #27892

@Thundercup

Description

@Thundercup

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

  • 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:

  1. If the user sets HTTPS_PROXY before launching the app from terminal → works
  2. If the user clicks the desktop app icon (no env vars) → broken
  3. 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:

  1. Set HTTPS_PROXY as a system environment variable and restart the desktop app
  2. Use a TUN/VPN mode proxy that routes traffic at the network level
  3. Launch the desktop app from a terminal where $env:HTTPS_PROXY is set

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions