Skip to content

Copilot commit message generation fails behind a proxy: SDK client env drops HTTPS_PROXY #23139

Open

Description

@abhi-kj

The problem

On a network with no direct internet access, where a proxy is set through HTTPS_PROXY, "Generate commit message with Copilot" fails with:
Execution failed: model resolution leaf failed: get_model_list: GenericFailure, Session was not created with authentication info or custom provider

Release version

3.6.10 (x64)

Operating system

Windows 11

Steps to reproduce the behavior

  1. Use a network where outbound HTTPS only works through a proxy, and set HTTPS_PROXY=http://: as a user environment variable.
  2. Sign in with an account that has Copilot (reproduced with both github.com and a *.ghe.com data-residency account).
  3. Click Generate commit message with Copilot.

Log files

[ERROR] [rust:copilot_runtime::auth::manager_orchestration] Failed to validate SDK token: network fetch failed: request failed: error sending request for url (https://api..ghe.com/copilot_internal/user)
[WARNING] [rust:turn_engine::native_message_turn] model resolution before the turn did not commit a new selection {"error":"model resolution leaf failed: get_model_list: GenericFailure, Session was not created with authentication info or custom provider"}

warn: [ui] CopilotStore: Failed to fetch and cache quota snapshots
Error: Request account.getQuota failed with message: network fetch failed: request failed: error sending request for url (https://api..ghe.com/copilot_internal/user)

Screenshots

No response

Additional context

No response

Activity

  1. desktop-triage commented on Nov 6, 2026

    @desktop-triage

    Suggesting bug, priority-2, and copilot: the report includes explicit error logs (network fetch failed, model resolution leaf failed) and a clear reproduction (network with only HTTPS_PROXY set), and it blocks a core Copilot feature with no in-app workaround for proxy-only networks. Duplicate check found no existing report of this proxy-specific failure mode (#23092 is about WSL path resolution, #22958 is about malformed JSON output — different root causes).

    Initial hypothesis: CopilotStore.createAssistedCommitClient builds the assisted-commit client's environment via getAssistedCommitClientEnvironment(), which explicitly allow-lists only HOME, USERPROFILE, HOMEDRIVE, HOMEPATH, COPILOT_HOME, XDG_CONFIG_HOME, PATH, TMPDIR, TEMP, TMP, NODE_EXTRA_CA_CERTS, SSL_CERT_FILE, and SSL_CERT_DIR from process.env (copilot-assisted-commit.ts#L509-L529). This result is passed as options.env into createClient, which spawns the Copilot runtime subprocess with env: { ...options.env, GH_HOST, GITHUB_COPILOT_INTEGRATION_ID } (copilot-store.ts#L988-L998), replacing rather than merging with the parent process environment. Since HTTPS_PROXY/https_proxy (and HTTP_PROXY/ALL_PROXY) are not in that allow-list, the spawned Copilot SDK subprocess loses the proxy configuration entirely, which would explain why its outbound requests to api.ghe.com/api.github.com fail on a proxy-only network even though the rest of GitHub Desktop (using Chromium's networking) works fine. The comment above the function ("The SDK replaces, rather than merges, an explicitly supplied environment") confirms this is an intentional, scoped allow-list rather than an oversight — but it appears not to account for proxy variables, which would need to be deliberately added to the list to fix this.

    Generated by Issue Triage (skills-driven) for #23139 · auto · 69.7 AIC · ⊞ 4.7K · ◷

  2. abhixkj commented on Nov 7, 2026

    @abhixkj

    I've opened a fix for this in #23141.

    Root cause: CopilotStore.createClient() passes an explicit env (GH_HOST, GITHUB_COPILOT_INTEGRATION_ID) to CopilotClient. The Copilot SDK uses that env instead of process.env (connEnv ?? options.env ?? process.env), which is also noted on getAssistedCommitClientEnvironment(). As a result HTTP(S)_PROXY, ALL_PROXY and NO_PROXY never reach the bundled runtime. It then tries to connect directly, token validation against /copilot_internal/user fails with network fetch failed, and the session ends up unauthenticated.

    Fix: forward only the non-empty proxy variables into the client env. This follows the same allowlist approach already used for NODE_EXTRA_CA_CERTS and SSL_CERT_*.

    Verification:

    • A unit test, plus a runtime test that checks the bundled runtime tunnels token validation through a local proxy taken from the forwarded HTTPS_PROXY.
    • Behind a corporate proxy, a dev build with the fix now passes token validation, where 3.6.10 fails.

    Could a maintainer triage this, and add help wanted if you're happy to take an external contribution? Thanks!

  3. added
    bug
    priority-2
    on Nov 9, 2026
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

    bugpriority-2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions