Skip to content

Built-in web_fetch does not work with HTTP proxies #4019

Description

@JoergStrebel

Describe the bug

I am running GH Copilot on WSL in a corporate environment and I cannot get the /research command or a simple prompted Web URL retrieval to work in GH Copilot CLI. It looks very much like GH Copilot CLI does not support mandatory HTTP proxies for Web access

> Please retrieve the URL https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
Fetching web content https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html · url: "https://maven.apache.org/guides/introduction/introduction-to…" TypeError: fetch failed
Fetch failed (network error / TypeError, possibly unreachable from this environment). Want me to retry, or try an alternate source (e.g., cached/mirrored version)?
> You should be able to access the URL via the http proxy settings in the environment.
Thought for 1s
Fetching web content https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html · url: "https://maven.apache.org/guides/introduction/introduction-to…" TypeError: fetch failed
Thought for 1s
Shell Check proxy env vars and fetch URL via curl 11 lines…
env | grep -i proxy; echo "---"; curl -sS -m 20 -o /tmp/maven.html -w "HTTP:%{http_code}\n" https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
Proxy env vars were set, and  curl  retrieved it successfully (HTTP 200). 
Successfully retrieved the page via curl (proxy env vars worked; the  web_fetch  tool itself doesn't honor them). Summary of the page — "Introduction to the Build Lifecycle" (Maven docs):

Copilot CLI can access the Web via curl but not via its built-in web_fetch tool.
Does anybody have an idea how to fix it?

Affected version

GitHub Copilot CLI 1.0.68.

Steps to reproduce the behavior

  1. Ask Github Copilot to retrieve any public URL from the Internet
  2. See how Copilot fails to retrieve it

Error message:
Fetching web content https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html · url: "https://maven.apache.org/guides/introduction/introduction-to…" TypeError: fetch failed
Fetch failed (network error / TypeError, possibly unreachable from this environment). Want me to retry, or try an alternate source (e.g., cached/mirrored version)?

Expected behavior

Internal tool web_fetch should honour existing HTTP proxy variables from the environment.

Additional context

  • Operating system: WSL2 on MS Windows 11
  • CPU architecture: x86_64
  • Terminal emulator: Windows Terminal
  • Shell: bash

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions