Repository navigation
agentHost: Resolve the Copilot runtime's proxies through SDK callbacks - #346706
Merged
Merged
Conversation
resolveProxyByURL now also returns the full PAC-style result, which the agent host passes to the Copilot runtime. Co-authored-by: Copilot <[email protected]>
Forwarding HTTP(S)_PROXY and NO_PROXY to the Copilot runtime could only express a single proxy, and the variables leaked into the tools the agent runs, sending requests to intranet hosts through a proxy meant for others. Register the Copilot SDK's network callbacks at runtime scope instead: - resolveProxy answers with the full PAC-style result of VS Code's proxy resolution (http.proxy, proxy environment variables, or the system and PAC settings of a connected client). When no client can answer, it leaves the request to the runtime's own resolution. - authenticateNegotiate looks up Kerberos tickets the same way the agent host does for its own requests. The callbacks are always registered, so the runtime no longer restarts when clients connect or disconnect, or when proxy settings change. Only Kerberos SPN and client certificate changes still restart it. Requires the Copilot SDK network callbacks and @vscode/proxy-agent 0.46.0. Co-authored-by: Copilot <[email protected]>
Picks up runtime 1.0.108-0, which adds the experimental network.resolveProxy and network.authenticateNegotiate callbacks and resolves team_customizations requests through them. CopilotSession.sessionId is now an accessor, so the launcher test fake overrides it as a getter. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Proxy authentication remains broken because authenticated proxy URL credentials are dropped and native Kerberos ticket acquisition can use the wrong principal or discard its explicit realm.
2 open issues
2 files not reviewed
pnpm-lock.yaml: Generated fileremote/pnpm-lock.yaml: Generated file
What changed in this PR
This PR moves the Copilot runtime’s proxy resolution and Kerberos authentication into SDK network callbacks backed by VS Code’s Agent Host, replacing injected proxy settings and reducing runtime restarts.
Changes:
- Upgrade the Copilot SDK, bundled runtime, and proxy-agent dependency.
- Add runtime-scoped callbacks for PAC proxy lists and Kerberos tokens.
- Update resolver interfaces, tests, smoke-test expectations, and networking documentation.
| File | Description |
|---|---|
test/smoke/src/areas/agentsWindow/remoteDevContainerFixtures.ts |
Update WSL callback-registration log checks. |
src/vs/platform/agentHost/test/node/localModelBridge/shimLocalModelProvider.test.ts |
Extend proxy resolver test stubs. |
src/vs/platform/agentHost/test/node/localModelBridge/localModelSetupService.test.ts |
Extend proxy resolver test stubs. |
src/vs/platform/agentHost/test/node/copilotSessionLauncher.test.ts |
Adapt the session fake to the SDK accessor. |
src/vs/platform/agentHost/test/node/copilotAgent.test.ts |
Cover callbacks and revised restart behavior. |
src/vs/platform/agentHost/test/node/agentServiceTestUtils.ts |
Update the shared resolver stub. |
src/vs/platform/agentHost/test/node/agentHostRequestService.test.ts |
Cover detailed proxy results and exposed Kerberos lookup. |
src/vs/platform/agentHost/node/serviceBootstrapping.md |
Document callback-based networking. |
src/vs/platform/agentHost/node/copilot/copilotAgent.ts |
Register callbacks and remove resolved-proxy environment injection. |
src/vs/platform/agentHost/node/agentHostProxyResolver.ts |
Expose detailed proxy resolution and Kerberos lookup. |
remote/pnpm-lock.yaml |
Lock upgraded remote dependencies. |
remote/package.json |
Update remote SDK, runtime, and proxy-agent versions. |
pnpm-lock.yaml |
Lock upgraded desktop dependencies. |
package.json |
Update desktop SDK, runtime, and proxy-agent versions. |
Review effort: Balanced
… bump Update the managed settings schema and Copilot prompt snapshots for SDK 1.0.30-preview.0, and accept the pinned WSL server's environment-forwarded proxy in the WSL Kerberos proxy smoke test. Co-authored-by: Copilot <[email protected]>
…l for the Copilot runtime A PAC-style proxy answer cannot carry credentials, so a configured http.proxy with credentials is forwarded to the Copilot runtime as HTTP_PROXY/HTTPS_PROXY/NO_PROXY again, and the resolveProxy callback defers to the runtime's own resolution for setting and environment proxies with credentials. The authenticateNegotiate callback now acquires this machine's ticket for exactly the principal the runtime requests, converted to a host-based name for GSSAPI as the runtime does, before falling back to clients sharing the network. Renderers on the same machine are no longer consulted for the runtime. Co-authored-by: Copilot <[email protected]>
Contributor
|
Base:
|
… like a remote extension host Use this machine's ticket first, then a client sharing its network, without asking local renderers, which run on the same machine. Remove the now unused Kerberos lookup from the renderer proxy channel. Co-authored-by: Copilot <[email protected]>
Christof Marti (chrmarti)
marked this pull request as ready for review
November 7, 2026 15:08
Christof Marti (chrmarti)
enabled auto-merge (squash)
November 7, 2026 15:08
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Bhavya U (@bhavyaus)Matched files:
|
Ladislau Szomoru (lszomoru)
approved these changes
Nov 7, 2026
This was referenced Nov 8, 2026
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.

The Agent Host now resolves the Copilot runtime's proxies and Kerberos tickets through the Copilot SDK's new network callbacks, instead of forwarding proxy environment variables to the runtime.
This is a draft, to test the published Copilot SDK
1.0.30-preview.0(runtime1.0.108-0) in CI.Changes
@github/copilot-sdkto1.0.30-preview.0andcopilotRuntimeVersionto1.0.108-0. This runtime adds the experimentalnetwork.resolveProxyandnetwork.authenticateNegotiatecallbacks, and also routes itsteam_customizationsrequests through them.resolveProxyanswers with the full PAC-style result of VS Code's proxy resolution (http.proxy, the proxy environment variables, or the system and PAC settings of a connected client). When no client can answer, or when the resolvedhttp.proxyor environment proxy has credentials, which a PAC-style answer cannot carry, it leaves the request to the runtime's own resolution.authenticateNegotiateacquires this machine's ticket for exactly the principal the runtime requests (as a host-based name for GSSAPI outside Windows, like the runtime), then falls back to a client sharing the Agent Host's network, such as the Windows client of an Agent Host in WSL. Renderers on the same machine are not consulted.http.proxyKerberosServicePrincipal, if set), then a client sharing its network. They no longer ask local renderers for tickets, so the renderer proxy channel drops its Kerberos lookup.HTTP(S)_PROXYandNO_PROXYto the runtime, except for anhttp.proxysetting with credentials. The runtime sends those credentials as Basic proxy authorization.@vscode/proxy-agentto0.46.0, whoseresolveProxyByURLalso returns the full PAC-style result.Why
Forwarding the proxy environment variables could express only a single proxy. The variables also leaked into the tools the agent runs, so requests to intranet hosts went through a proxy meant for other hosts. When the Agent Host runs in WSL or a dev container, the proxy and Kerberos configuration is on the client machine. The callbacks let the runtime use the connected VS Code client's proxy resolution and Kerberos tickets.
The callbacks are always registered, so the runtime no longer restarts when clients connect or disconnect, or when proxy settings change. Only Kerberos SPN, client certificate, and credentialed
http.proxychanges still restart it.Notes for reviewers
CopilotSession.sessionIdis an accessor, so a test fake incopilotSessionLauncher.test.tsnow overrides it as a getter.RUNTIME_PAC_TYPESfiltering incopilotAgent.ts.How to test
In CI, the Windows Electron-Smoke (WSL) job runs the WSL Kerberos proxy smoke tests (
test/smoke/scripts/run-agents-window-wsl-kerberos-proxy.ps1). The macOS PAC and Kerberos proxy smoke tests run in the Azure product build.Local validation with this SDK, on Windows:
pnpm run typecheck-client: passed.scripts\test.bat --reporter dot --runGlob "vs/platform/agentHost/test/node/copilot*.test.js": passed (3875 passing, 11 pending).scripts\test.bat --reporter dot --run src/vs/platform/agentHost/test/node/copilotAgent.test.ts --run src/vs/platform/agentHost/test/node/agentHostRequestService.test.ts: passed (1082 passing).pnpm run eslinton the changed files: passed.The WSL Kerberos proxy smoke tests were not run locally against this published runtime. With a locally built runtime containing the same changes, they passed through both an HTTP and an HTTPS proxy, and the runtime's
team_customizationsrequests went through the proxy.