GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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 #27892

New issue
Copy link
New issue
Copy link
Open
#65540
Open
[Desktop][Windows] webfetch tool does not respect system proxy settings — feature request: add proxy config in settings UI#27892
#65540
Copy link
Assignees
Hona

Description

@Thundercup
Thundercup
opened on May 16, 2026
Issue body actions

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
Reacted by 21hook, XieB, 145a, Artyom Ezri, Jeremy and Dominic Gebhart

Activity

  1. github-actions
    assigned
    Hona
    on May 16, 2026
  2. github-actions commented on May 16, 2026

    @github-actions
    github-actionsBot
    on May 16, 2026 – with GitHub Actions
    Contributor
    More actions

    This issue might be a duplicate of existing issues. Please check:

    • [FEATURE]: Support explicit proxy configuration in opencode config #24981: Very similar feature request for explicit proxy configuration in opencode.json with nearly identical proposed config structure
    • [FEATURE]:Add Proxy Configuration (Support Socks Protocol & Blacklist/Whitelist with Wildcards) #18193: Feature request for proxy configuration with blacklist/whitelist support
    • Support HTTP_PROXY & HTTPS_PROXY for millions of users who are behind fire walls in some regions and some organizations. #531: Long-standing request for HTTP_PROXY/HTTPS_PROXY support (especially for users behind firewalls/GFW)

    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.

  3. Thundercup commented on May 16, 2026

    @Thundercup
    Thundercup
    on May 16, 2026
    Author
    More actions

    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).

  4. 0x80x commented on Jul 15, 2026

    @0x80x
    0x80x
    on Jul 15, 2026
    More actions

    I'd like to work on implementing this. A few things I'd add to the scope:

    1. 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.

    2. 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)
    3. 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
  5. coinsoundsbetter commented on Aug 28, 2026

    @coinsoundsbetter
    coinsoundsbetter
    on Aug 28, 2026
    More actions

    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:

    1. Should the initial UI support Use environment proxy, Direct, and Manual proxy modes?
    2. Should configurable NO_PROXY rules and proxy authentication be included in the first PR, or follow separately?
    3. 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.

  6. TCXM commented on Oct 7, 2026

    @TCXM
    TCXM
    on Oct 7, 2026
    More actions

    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?

  7. opencodejr commented on Oct 29, 2026

    @opencodejr
    opencodejrBot
    on Oct 29, 2026
    Contributor
    More actions

    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:

    • [FEATURE]: Support explicit proxy configuration in opencode config #24981: proxy setting in opencode.json (the config part of this request)
    • core: ripgrep auto-download fails silently behind Windows system proxy and never recovers until restart #51022: same Windows system proxy gap, for the ripgrep download
    • GitHub Copilot OAuth fails on Windows behind v2rayN/system proxy unless HTTP_PROXY/HTTPS_PROXY are set explicitly #26629: same gap, for GitHub Copilot sign-in
    • HTTPS_PROXY env not working in v2, but works in v1 #51247: report that HTTPS_PROXY does not work in v2
    • Browser tool does not respect the remote server's proxy settings when Desktop connects to a remote server #50476: browser tool ignoring proxy settings when Desktop connects to a remote server
  8. opencodejr
    marked proxy settings in desktop #63841 as a duplicate of this issue on Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @Hona
    Hona

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.