-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
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
- 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"
- Verify the proxy works independently:
curl.exe -x http://proxy.example.com:3128 https://api.github.com # returns HTTP 200
- Start
copilot—Error auto updating: TypeError: fetch failedappears on startup - Ask Copilot to fetch any HTTPS URL via
web_fetch— sameTypeError: 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+ restartingcopilothas 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.execonnections through the proxy at OS level - Related: FR: Support for HTTPS_PROXY (web proxies) #41