Honor HTTP proxy bypass settings in the agent host - #333614
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
Review tier: Balanced
Findings: None
What changed in this PR
Forwards VS Code proxy bypass configuration to the Copilot runtime while preserving proxy precedence.
Changes:
- Normalizes and forwards
http.noProxyasNO_PROXY. - Makes explicit proxy settings override inherited proxy variables.
- Restarts the runtime when bypass settings change and adds regression coverage.
| File | Description |
|---|---|
src/vs/platform/agentHost/node/copilot/copilotAgent.ts |
Applies proxy and bypass precedence to runtime environments. |
src/vs/platform/agentHost/test/node/copilotAgent.test.ts |
Tests forwarding, precedence, restoration, and runtime restarts. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Forward http.noProxy to the Copilot runtime and keep configured proxy settings authoritative over inherited proxy environment variables. Fixes #326185 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the effective proxy bypass list while the Copilot runtime resolves native managed settings, restoring all inherited environment variants afterward. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Filter proxy aliases case-insensitively while cloning the Windows environment, preserve unrelated key casing, and apply canonical proxy values only to the Copilot subprocess copy. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Christof Marti (chrmarti)
force-pushed
the
chrmarti/private-no-proxy
branch
from
September 1, 2026 14:23
3c4ca4d to
4951f90
Compare
Account for Windows process.env resolving canonical proxy variables through lowercase aliases in the managed-settings test. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Christof Marti (chrmarti)
marked this pull request as ready for review
September 1, 2026 15:35
Christof Marti (chrmarti)
enabled auto-merge (squash)
September 1, 2026 15:35
Dirk Bäumer (dbaeumer)
approved these changes
Sep 1, 2026
Bhavya U (bhavyaus)
pushed a commit
that referenced
this pull request
Sep 1, 2026
* agentHost: honor HTTP proxy bypass settings Forward http.noProxy to the Copilot runtime and keep configured proxy settings authoritative over inherited proxy environment variables. Fixes #326185 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * agentHost: apply no-proxy to managed settings Use the effective proxy bypass list while the Copilot runtime resolves native managed settings, restoring all inherited environment variants afterward. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * agentHost: handle Windows proxy environment casing Filter proxy aliases case-insensitively while cloning the Windows environment, preserve unrelated key casing, and apply canonical proxy values only to the Copilot subprocess copy. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * agentHost: fix Windows proxy env assertion Account for Windows process.env resolving canonical proxy variables through lowercase aliases in the managed-settings test. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Forward
http.noProxyto the Copilot runtime so BYOK requests to configured local or direct endpoints bypass the HTTP proxy.Also align the Copilot subprocess with VS Code proxy precedence: an explicit
http.proxyoverrides inherited proxy environment variables, environment-only proxy configuration is preserved, and OS/PAC discovery remains the final fallback.Fixes #326185
Session Context
Key decisions from the development session:
HTTP_PROXY,HTTPS_PROXY, andNO_PROXYonly. Lowercase andALL_PROXYvariants are removed when an explicit VS Code proxy setting is applied because the Copilot runtime otherwise gives inherited lowercase values precedence.http.proxyis trimmed but not parsed or normalized in VS Code. This layer owns precedence and propagation; the Copilot runtime remains responsible for interpreting and validating the proxy URL.http.proxyis unset, existing proxy environment variables are left untouched rather than collapsed into a single proxy URL.http.noProxyrestarts the runtime using the existing deferred restart mechanism.Changes
http.noProxyentries asNO_PROXY.http.proxyauthoritative over inherited proxy variables.Validation
npm run transpile-client./scripts/test.sh --run src/vs/platform/agentHost/test/node/copilotAgent.test.ts --grep "(queries managed settings with pre-resolved token authentication|proxy)"(21 passing locally; Windows-only casing regression test pending on macOS and runs in Windows CI)