Skip to content

web_fetch and auto-update fail with TypeError: fetch failed behind corporate proxy #2395

Closed

Description

@mu88

Describe the bug

On Windows behind a corporate HTTP proxy, web_fetch and auto-update fail with
TypeError: fetch failed, even when HTTP_PROXY and HTTPS_PROXY are set as documented in
copilot help environment. curl.exe through the same proxy works fine, so the proxy itself
is not the issue.

My best guess for the root cause: copilot.exe appears to be a self-contained executable
that may ship with an embedded Node.js runtime. If that runtime is older than v23.8.0, native
fetch (undici) would silently ignore proxy env vars, since NODE_USE_ENV_PROXY=1 support
was only added in v23.8.0. Switching the system Node via nvm has no effect, which is
consistent with this theory — but I'm not certain this is the actual cause.

Affected version

GitHub Copilot CLI 1.0.3 (Installed via MSI from GitHub Releases)

Steps to reproduce the behavior

  1. Set proxy environment variables in PowerShell:
    $env:HTTP_PROXY  = "http://proxy.example.com:3128"
    $env:HTTPS_PROXY = "http://proxy.example.com:3128"
    $env:http_proxy  = "http://proxy.example.com:3128"
    $env:https_proxy = "http://proxy.example.com:3128"
    $env:NODE_USE_ENV_PROXY = "1"
    $env:NODE_USE_SYSTEM_CA = "1"
  2. Verify the proxy works independently:
    curl.exe -x http://proxy.example.com:3128 https://api.github.com  # returns HTTP 200
  3. Start copilot — Error auto updating: TypeError: fetch failed appears on startup
  4. Ask Copilot to fetch any HTTPS URL via web_fetch — same TypeError: fetch failed

Expected behavior

HTTP_PROXY / HTTPS_PROXY should be respected for all outgoing connections, as documented in copilot help environment.

Additional context

  • Operating system: Windows 11
  • CPU architecture: x86_64
  • Shell: PowerShell 7
  • Terminal: Windows Terminal
  • Installed via: MSI from GitHub Releases
  • nvm use 23.8.0 + restarting copilot has no effect (suggesting the bundled runtime is used regardless of system Node)
  • Potential workaround (untested): a transparent OS-level proxy tool (e.g. Proxifier) that forces copilot.exe connections through the proxy at OS level
  • Related: FR: Support for HTTPS_PROXY (web proxies) #41

Activity

  1. added theissue type on Mar 30, 2026
  2. added
    area:networking
    on Apr 6, 2026
  3. added
    area:installation
    on Apr 6, 2026
  4. mu88 commented on Apr 29, 2026

    @mu88
    Author

    This appears to be fixed in v1.0.37. The embedded Node.js is now v24.11.1, which supports NODE_USE_ENV_PROXY=1 natively. Setting NODE_USE_ENV_PROXY=1 together with HTTP_PROXY/HTTPS_PROXY in the process environment resolves the TypeError: fetch failed error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:installationarea:networking

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions