Skip to content

copilot-sdk harness drops proxy variables, so the Planner can't run behind a proxy #759

Closed

Description

@alexgnq

When Chopin runs behind an HTTPS proxy, the Planner fails with "The Planner stream failed. Try again." The server logs:

Request session.create failed with message: network fetch failed: request failed:
error sending request for url (https://api.github.com/copilot_internal/user)

defaultConnect in apps/server/src/harness/copilot-sdk/adapter.ts creates the client with
env: { COPILOT_PLUGIN_DIR_ONLY: "true" }. The SDK uses that as the CLI's whole environment, so
HTTPS_PROXY, HTTP_PROXY and NO_PROXY never reach the CLI. The server process itself uses the
proxy, so sign-in and the GitHub tools work; only the CLI goes direct.

Suggested fix: pass the proxy variables through, for example

env: { ...pick(process.env, ["HTTPS_PROXY", "HTTP_PROXY", "NO_PROXY", "https_proxy", "http_proxy", "no_proxy"]), COPILOT_PLUGIN_DIR_ONLY: "true" }

Same for any other place that creates a CopilotClient with env.

Seen at e47b1a5. We work around it by pointing COPILOT_CLI_PATH at a
script that sets the proxy and execs the bundled CLI.

Activity

  1. alexgnq commented on Nov 2, 2026

    @alexgnq
    Author

    I'm glad to work on implementing this as well, if that helps.

  2. self-assigned this
    on Nov 5, 2026
  3. lavaman131 commented on Nov 5, 2026

    @lavaman131
    Collaborator

    Thanks for offering @alexgnq, and for pointing straight at defaultConnect. I've got this one covered, and I'll link the PR here when it's up.

  4. lavaman131 commented on Nov 5, 2026

    @lavaman131
    Collaborator

    The fix is up in #785: the Copilot CLI now gets HTTPS_PROXY, HTTP_PROXY, NO_PROXY and the CA certificate variables from the server, and nothing else.

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

Metadata

Metadata

Assignees

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