Skip to content

agentHost: Use the client's proxy and Kerberos tickets for WSL and local containers - #345225

Merged
Christof Marti (chrmarti) merged 14 commits into
mainfrom
chrmarti/kerberos-auth-callback
Nov 1, 2026
Merged

Christof Marti (chrmarti) merged 14 commits into
mainfrom
chrmarti/kerberos-auth-callback

Conversation

@chrmarti

@chrmarti Christof Marti (chrmarti) commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Related to #342540.

An Agent Host in WSL or a local Dev Container now uses the client's proxy configuration and falls back to the client's Kerberos tickets, the same way a remote extension host with useHostProxy does (proxyResolver.ts). This covers the Agents window's WSL and Dev Container connections and editor windows connected to WSL or Dev Containers.

Changes

  • Which connections. WSL always counts. A Dev Container counts only when the existing certificate-forwarding detection (agentHost: Forward client certificates to WSL and local containers #343431) finds a local Docker endpoint: DOCKER_HOST, then the active context, must be unix:// or npipe://. The flag is renamed from forwardClientCertificates to sharesClientNetwork, since certificates, proxy and Kerberos now all depend on it. Editor-window remotes use the same useHostProxy gate as certificates.
  • Proxy resolution. Such clients advertise vscode.clientProxy and serve vscode/resolveProxy. While one is connected, the Agent Host resolves proxies through it after http.proxy and the proxy environment variables. PAC and system proxies resolved on the client therefore apply to the Agent Host's own requests and to the Copilot runtime's HTTPS_PROXY. As for a remote extension host, http.useLocalProxyConfiguration: false turns this off.
  • Kerberos. The Agent Host and the Copilot runtime use their own tickets first and fall back to vscode/lookupProxyKerberosAuthorization. The client answers through IRequestService.lookupKerberosAuthorization, which uses the platform's principal syntax (HTTP@host on macOS and Linux) and honors http.proxyKerberosServicePrincipal. It only issues tickets for proxies it points the Agent Host at: its http.proxy setting, proxies it resolved for that Agent Host, or its system proxy for GitHub Copilot. With a principal override configured, tickets are only for that principal.
  • Copilot runtime. The runtime's fallback uses the SDK kerberosAuth option from github/copilot-agent-runtime#30203 (mode: 'fallback', scope: 'runtime'). Desktop and remote now pin the Universe SDK build 1.0.27-unstable.41214319014.g4f70995, with runtime 1.0.103-unstable.r41214319014.g4f70995, which includes it (github/copilot-agent-runtime#31352). The option is type-checked against the SDK's own KerberosAuthConfig, replacing the local declaration that older SDKs ignored. Besides the callback, the build brings the Universe branch's other changes since the previous pin, including the Entra token callbacks (github/copilot-agent-runtime#30708).
  • Smoke tests. Two opt-in suites and their Windows runner test/smoke/scripts/run-agents-window-wsl-kerberos-proxy.ps1 cover an Agent Host in WSL that reaches the HTTPS mock model server only through a Kerberos-authenticated Squid proxy. Agents Window (WSL AgentHost, Kerberos proxy) starts the Agent Host from the Agents window. Editor Window (WSL remote AgentHost, Kerberos proxy) opens an editor window on a VS Code server in WSL, which spawns the Agent Host.
    • The proxy comes from a Windows PAC. The Kerberos tickets come from a network-only logon to a test realm whose KDC runs in WSL. The mock server's CA comes from the Windows trust store. WSL gets none of them, and its ticket cache is empty.
    • The Agents window suite checks that the client answered vscode/resolveProxy with the PAC's proxy and returned a Kerberos token and certificates.
    • The editor window suite opens an Agent Host Copilot chat editor (new smoketest.openAgentHostChat helper) and waits for the reply and its model request. That connection writes no protocol transcript, so it checks the server's Agent Host log for the mock CAPI URL and the client-resolved proxy.
    • For that suite, the test resolver resolves wsl+<distribution> when the fixture passes the server command in TESTRESOLVER_WSL_SERVER_COMMAND. It starts the server in WSL with --use-host-proxy, like the WSL extension does, and waits until WSL forwards the server's port to Windows. The automation's new remoteAuthority option opens the workspace with that authority. The remote window gets its own extensions directory, because a packaged build's late copy of the test resolver into the shared one is dropped once an earlier window registered it.
    • The runner checks the authenticated tunnels in Squid's log and the tickets the KDC issued to Windows, and reverts all machine changes.
    • The runner prompts for administrator rights unless it already runs elevated, as on CI agents; in CI it fails instead of prompting. connectWSLHost can now wait for a folder entry other than .devcontainer.
    • They are not in CI yet. Once a published Insiders server contains this change, a follow-up will pin it like the WSL Dev Container suite does, install the KDC and Squid packages in the CI WSL distribution, and run the runner in the WSL smoke shard.
  • Local model test. The new runtime attributes /auto routing requests to the session whose turn they route, so copilotLocalModel.integrationTest.ts now expects that session there.

How to test

  1. On Windows, behind a proxy that requires Kerberos (Negotiate), open the Agents window and connect to a WSL distro without its own Kerberos tickets.
  2. Start a Copilot session. The Agent Host log shows the proxy resolved through the client, and Agent Host and Copilot runtime requests through the proxy succeed with the Windows user's tickets.
  3. Repeat with a Dev Container on local Docker Desktop, and with an editor window connected to WSL.
  4. Set http.useLocalProxyConfiguration to false: the Agent Host no longer resolves proxies through the client.

Or run the smoke tests, with the distro packages and WSL source checkout described in test/smoke/README.md:

.\test\smoke\scripts\run-agents-window-wsl-kerberos-proxy.ps1 -Distribution Ubuntu -WslServerPath ~/devel/vscode -WslNodePath ~/.local/node/bin/node

Validation

  • Rebased on main at 8fb60541db0. The conflicts were in agentHostProtocolClient.ts and copilotAgent.test.ts, where main added a resourceUris client option and an IRequestService parameter to CopilotAgent; both were kept.
  • npm run typecheck-client: passed after the rebase, against the new SDK.
  • npm run build-fast -- --client-only: passed after the rebase.
  • npm run valid-layers-check: passed, before an earlier rebase; no later commit changes imports across layers.
  • npm run eslint -- <changed files>: passed.
  • scripts\test.bat --reporter dot --run src\vs\platform\agentHost\test\browser\agentHostClientProxy.test.ts --run src\vs\platform\agentHost\test\common\agentHostConfigurationSync.test.ts --run src\vs\platform\agentHost\test\electron-browser\agentHostProtocolClient.test.ts --run src\vs\platform\agentHost\test\electron-browser\localAgentHostService.test.ts --run src\vs\platform\agentHost\test\node\agentHostRequestService.test.ts --run src\vs\platform\agentHost\test\node\copilotAgent.test.ts --run src\vs\platform\agentHost\test\node\protocolServerHandler.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\electron-browser\devContainerAgentHostConnector.test.ts: 1988 passing, 1 pending, after the rebase.
  • scripts\test-integration.bat --run src/vs/platform/agentHost/test/node/e2e/providers/copilotAgentHostE2E.integrationTest.ts, Copilot Agent Host E2E replay with the new SDK: 251 passing, 53 pending, 1 failing.
    • The failure is server tool: create_session materializes a selected-model child session and starts its prompt: the child chat's title was still empty when read after the chat went idle.
    • The test passed in two isolated reruns with --grep. No fixtures changed.
  • scripts\test-integration.bat --run src/vs/platform/agentHost/test/node/providerIntegration/copilotLocalModel.integrationTest.ts: 10 passing with the updated /auto expectation. It had failed on all three platforms in PR CI after the SDK bump.
  • Azure build 491685 of 337fa77f364: full product build with tests on all platforms, without publishing. All compile and test jobs passed; the macOS signing jobs were still running when this was marked ready. Build 491683 found that the client proxy unit tests depended on the build agent's http_proxy; they now use a resolver that ignores proxy environment variables.
  • Azure build 491659 of 03eef985b77 built Windows x64 and Linux x64 artifacts, without publishing or tests. The smoke tests passed elevated against its packaged Insiders client (--build) and its Linux server extracted in WSL, which is how CI will run them. The WSL Agent Host used the server's bundled runtime.
    • With the editor window suite (f3944fb70ae, before the rebase), both suites passed in one run (-ProxyScheme Http). In the editor window suite, the server-spawned Agent Host used the mock CAPI URL and the client-resolved proxy, and its runtime logged native Kerberos credentials unavailable; trying Kerberos callback.
    • npm run compile in test/smoke, npm run gulp compile-extension:vscode-test-resolver and npm run eslint -- <changed files> passed for this commit.
  • The Agents window smoke test passed on Windows 11 with Ubuntu in WSL, using the bundled Linux runtime of the new SDK and no runtime override.
    • This run used a source checkout in WSL and ran elevated, so the machine configuration was applied without prompts, as on a CI agent.
    • An earlier revision of the runner also passed unelevated, with its two administrator prompts. The prompted path now passes its arguments differently; I checked the new quoting by having an unelevated stand-in script record the parameters it received.
    • The WSL runtime's own Kerberos lookup failed, it fell back to the callback, and Squid logged Kerberos-authenticated tunnels for the client's user. The machine configuration was restored afterwards.
  • Not tested end to end: Dev Containers, editor windows through the WSL extension rather than the test resolver, and macOS and Linux clients.

Copilot AI balanced review requested due to automatic review settings October 30, 2026 17:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A remote-only principal override can authorize local proxy tickets for unrelated hosts, creating a critical trust-boundary violation.

3 open issues
What changed in this PR

Extends existing certificate forwarding so Agent Hosts in WSL and local Dev Containers can also use the client’s proxy resolution and Kerberos tickets, addressing the networking failures described in #342540.

Changes:

  • Adds client-proxy capability negotiation and reverse requests, with proxy-host authorization checks and ticket redaction.
  • Connects eligible WSL, container, and remote-editor clients to proxy resolution and native-first Kerberos fallback.
  • Adds tests and documentation; Copilot runtime Kerberos fallback remains dependent on a future SDK update.
File Description
src/​vs/​workbench/​services/​agentHost/​browser/​editorRemoteAgentHostServiceClient.ts Enables proxy support for eligible remote editors.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​test/​electron-browser/​devContainerAgentHostConnector.test.ts Updates connection fixtures for the renamed flag.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​electron-browser/​devContainerAgentHostConnector.contribution.ts Supplies proxy providers for local containers.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​browser/​devContainerAgentHostService.ts Passes proxy providers to protocol clients.
src/​vs/​sessions/​common/​devContainerAgentHostService.ts Adds the connection’s optional proxy provider.
src/​vs/​platform/​agentHost/​test/​node/​protocolServerHandler.test.ts Tests capability gating, disconnects, and relay exclusion.
src/​vs/​platform/​agentHost/​test/​node/​localModelBridge/​shimLocalModelProvider.test.ts Updates the proxy resolver stub.
src/​vs/​platform/​agentHost/​test/​node/​localModelBridge/​localModelSetupService.test.ts Updates the proxy resolver stub.
src/​vs/​platform/​agentHost/​test/​node/​devContainerAgentHostService.test.ts Updates locality tests for network sharing.
src/​vs/​platform/​agentHost/​test/​node/​copilotAgent.test.ts Tests runtime Kerberos callback registration.
src/​vs/​platform/​agentHost/​test/​node/​agentServiceTestUtils.ts Extends shared proxy resolver test utilities.
src/​vs/​platform/​agentHost/​test/​node/​agentHostRequestService.test.ts Tests shared-client resolution and Kerberos fallback.
src/​vs/​platform/​agentHost/​test/​electron-browser/​wslRemoteAgentHostService.test.ts Adds the request-service stub for WSL tests.
src/​vs/​platform/​agentHost/​test/​electron-browser/​agentHostProtocolClient.test.ts Tests proxy requests, validation, and capability advertisement.
src/​vs/​platform/​agentHost/​test/​common/​ahpJsonlLogger.test.ts Tests authorization redaction without live-value mutation.
src/​vs/​platform/​agentHost/​test/​browser/​agentHostClientProxy.test.ts Tests proxy eligibility and configuration gates.
src/​vs/​platform/​agentHost/​node/​serviceBootstrapping.md Documents shared-network proxy and Kerberos behavior.
src/​vs/​platform/​agentHost/​node/​protocolServerHandler.ts Registers eligible clients for reverse proxy requests.
src/​vs/​platform/​agentHost/​node/​devContainerAgentHostService.ts Renames certificate eligibility to network sharing.
src/​vs/​platform/​agentHost/​node/​copilot/​copilotAgent.ts Adds the SDK-compatible runtime Kerberos callback.
src/​vs/​platform/​agentHost/​node/​agentHostProxyResolver.ts Resolves proxies and falls back to shared-client tickets.
src/​vs/​platform/​agentHost/​electron-browser/​wslRemoteAgentHostServiceImpl.ts Supplies WSL connections with client proxy support.
src/​vs/​platform/​agentHost/​common/​meta/​vscode/​agentHostClientProxyMeta.ts Defines and validates the optional capability.
src/​vs/​platform/​agentHost/​common/​meta/​agentHostClientProxyMeta.ts Exposes the capability through the shared metadata API.
src/​vs/​platform/​agentHost/​common/​devContainerAgentHost.ts Renames the connection eligibility field.
src/​vs/​platform/​agentHost/​common/​clientProxyProtocol.ts Defines proxy request validators and provider contracts.
src/​vs/​platform/​agentHost/​common/​ahpJsonlLogger.ts Redacts authorization strings from protocol logs.
src/​vs/​platform/​agentHost/​common/​agentHostExtensionProtocol.ts Adds typed reverse proxy commands.
src/​vs/​platform/​agentHost/​browser/​agentHostProtocolClient.ts Advertises and serves client proxy requests.
src/​vs/​platform/​agentHost/​browser/​agentHostClientProxy.ts Implements client proxy resolution and ticket eligibility.

Review effort: Balanced

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Base: 8fb60541 Current: f8b6b910

No screenshot changes.

Register a fallback Kerberos callback with the Copilot SDK so the runtime can obtain SPNEGO tokens from a connected client when its own lookup fails. The Windows client of a WSL agent host advertises vscode.kerberosAuth and answers lookups for HTTP service principals using the native host's Kerberos support. Tokens are redacted from AHP logs.

Co-authored-by: Copilot <[email protected]>
Before answering a WSL agent host's Kerberos lookup, resolve the proxy for GitHub Copilot traffic the way the agent host does: the http.proxy setting, else the system proxy for the account's Copilot API endpoint (unless system proxy discovery is disabled). Only HTTP principals for that proxy, or the configured http.proxyKerberosServicePrincipal while a proxy is in use, receive a token.

Co-authored-by: Copilot <[email protected]>
…time traffic

The runtime now scopes SDK Kerberos callbacks to the registering connection. The agent host owns its runtime process, so it claims the runtime scope to also cover the runtime's shared background traffic.

Co-authored-by: Copilot <[email protected]>
The SDK callback now receives an AbortSignal for runtime cancellation.

Co-authored-by: Copilot <[email protected]>
…s sharing its network

An agent host in WSL or a local Dev Container, reached from the Agents window or an editor window with useHostProxy, now behaves like a remote extension host that uses the local proxy configuration. Its client advertises vscode.clientProxy and serves vscode/resolveProxy, unless http.useLocalProxyConfiguration is off, so PAC and system proxies resolved on the client apply to the agent host's requests and the Copilot runtime. For Kerberos proxy authentication, the agent host and the runtime use their own tickets first and fall back to vscode/lookupProxyKerberosAuthorization, which the client answers through IRequestService with the platform's principal syntax and only for proxies it points the agent host at.

Dev Container locality uses the existing certificate detection, now named sharesClientNetwork. The Kerberos-only reverse request, its capability, and the native-host token lookup are replaced.

Co-authored-by: Copilot <[email protected]>
…r Copilot SDK

Declare the SDK's kerberosAuth client option locally and type the client options as its intersection with CopilotClientOptions. The pinned SDK compiles and ignores the extra option at runtime; an SDK release with the option registers the callback without further changes. The shape is checked to stay assignable to the released SDK's KerberosAuthConfig.

Co-authored-by: Copilot <[email protected]>
…opagate client proxy changes

Remote settings could widen which proxies an agent host may get this client's Kerberos tickets for, because the native lookup reads only local settings: read http.proxy and http.proxyKerberosServicePrincipal from the same local and default layers. When the client's proxy settings change, such as http.useLocalProxyConfiguration, it now reports vscode/clientProxyChanged to hosts that confirm serving its proxy support, so they drop cached resolutions and restart the Copilot runtime if its proxy changed.

Co-authored-by: Copilot <[email protected]>
…lback

Pin desktop and remote to SDK 1.0.27-unstable.41214319014.g4f70995 and
runtime 1.0.103-unstable.r41214319014.g4f70995, built from the Universe
branch with the SDK Kerberos callback (copilot-agent-runtime #31352). Use
the SDK's own kerberosAuth client option type instead of the local
declaration that let older SDKs ignore it.

Co-authored-by: Copilot <[email protected]>
Add an opt-in Agents Window suite and a Windows runner for an agent host
in WSL that reaches the HTTPS mock model server only through a
Kerberos-authenticated Squid proxy. The proxy comes from a Windows PAC,
the Kerberos tickets from a network-only logon to a test realm whose KDC
runs in WSL, and the mock server's CA from the Windows trust store, so
the WSL distribution needs none of them. The suite checks that the client
resolved the proxy and returned a Kerberos token and certificates; the
runner checks the authenticated tunnels and KDC tickets and reverts all
machine changes. It prompts for administrator rights unless it already
runs elevated, as on CI agents.

Co-authored-by: Copilot <[email protected]>
The Universe runtime now attributes /auto routing requests to the session
whose turn they route, still without an agent or interaction type.

Co-authored-by: Copilot <[email protected]>
Without positional binding, `--build <path>` and other smoke test arguments
bound to the runner's own parameters, such as -WslNodePath, instead of
reaching the smoke test.

Co-authored-by: Copilot <[email protected]>
…beros proxy

Adds an editor window suite next to the Agents Window one: the test
resolver starts a VS Code server in WSL for `wsl+<distribution>` when the
fixture provides the server command, and the server spawns the Agent Host,
which must use the client's proxy, Kerberos ticket and certificates.

Co-authored-by: Copilot <[email protected]>
@chrmarti
Christof Marti (chrmarti) force-pushed the chrmarti/kerberos-auth-callback branch from f3944fb to 8ccc195 Compare November 1, 2026 21:26
The disabled-AI smoke test rejects palette commands named with "Agent",
like the other smoke helpers' titles avoid "Chat" and "Copilot".

Co-authored-by: Copilot <[email protected]>
…bles

Proxy environment variables take precedence over a client sharing the
network, so the client proxy tests failed on build agents that set
`http_proxy`. The tests now use a resolver that ignores them.

Co-authored-by: Copilot <[email protected]>
@chrmarti
Christof Marti (chrmarti) marked this pull request as ready for review November 1, 2026 23:30
@chrmarti
Christof Marti (chrmarti) merged commit 937c6e9 into main Nov 1, 2026
104 of 107 checks passed
@chrmarti
Christof Marti (chrmarti) deleted the chrmarti/kerberos-auth-callback branch November 1, 2026 23:36
@vs-code-engineering vs-code-engineering Bot added this to the 1.145.0 milestone Nov 1, 2026
@bryanchen-d

Copy link
Copy Markdown
Collaborator

Christof Marti (@chrmarti) a heads-up, since this looks like the newly published Insiders interacting with this change. Since this morning, main CI's Linux Electron smoke test Agents Window (Dev Container AgentHost) › Starts a session in a Dev Container fails deterministically (491729, both attempts). The session never gets past "New Session".

What the logs show:

  • CI builds aren't published, so the container's CLI download for the CI commit returns 404, and it falls back to the latest published Insiders server.
  • The last green run, 491720 at 06:08 UTC, used caeec36b81. The first red run, 491729 at 07:43 UTC, used 67710841ad, the build published from this morning's 05:00 UTC insider. That build is the first one that contains this PR (937c6e91fd) and the Universe Copilot SDK adoption (6212de6ee1).
  • In the failing run, the container agent host's Copilot models.list fails repeatedly with Failed to fetch Copilot user info: 502 Bad Gateway, and nothing ever reaches the mock server. In the green run, the same step found the 4 mock models.
  • The container is configured with COPILOT_API_URL and COPILOT_DEBUG_GITHUB_API_URL = http://vscode-smoke.test:<port>, a name that only resolves inside the container (--add-host).

Hypothesis (unconfirmed): with "use the client's proxy … for local containers", the container's Copilot traffic now goes through the client-side proxy. That proxy can't resolve vscode-smoke.test on the host, so it answers 502. The 1.146.0 version bump in the same CI batch looks unrelated.

Exposure: every main CI and official insider will hit this, because the smoke test always uses the latest published Insiders server. Today's 17:00 UTC insider is a releasing slot. Can you take a look? We're happy to help verify a fix.

Co-authored with Copilot

@bryanchen-d

Copy link
Copy Markdown
Collaborator

Christof Marti (@chrmarti) adding confirmation to the comment above. The traces from 491729's Dev Container suite prove the proxy mechanism:

  • The container agent host (server 67710841ad) calls vscode/resolveProxy for http://vscode-smoke.test:35627, and the Linux CI client answers {"proxy":"PROXY 10.1.0.30:18080"}, the build agent's proxy. vscode-smoke.test only resolves inside the container (--add-host=vscode-smoke.test:host-gateway), so the agent proxy returns 502 Bad Gateway. That leads to models.list / Failed to fetch Copilot user info: 502 and then resolveSessionConfig → "Unable to load your organization's managed settings".
  • In green 491720 (container server caeec36b81, before this PR), the devcontainer connection's AHP trace has 0 vscode/resolveProxy calls.

So I see this as the expected useHostProxy-style behavior meeting a container-only hostname in the smoke setup, not a product bug. I'm proposing a test-only fix: add NO_PROXY/no_proxy: vscode-smoke.test to the smoke devcontainer's containerEnv. @vscode/proxy-agent checks env no_proxy before host-proxy resolution, so the agent host and the Copilot runtime go direct. I'll prove it with a def 111 run and open a draft. If you'd rather fix it differently, for example have the client return DIRECT for hosts it can't resolve, say so and I'll close mine.

Co-authored with Copilot

Ladislau Szomoru (lszomoru) pushed a commit that referenced this pull request Nov 2, 2026
…45546)

An Agent Host in a local Dev Container or WSL resolves proxies through the
client (#345225). The resolution can land while the first CopilotClient
starts, restarting it right away. resolveSessionConfig then resolved
managed settings on the stopped client and failed with "Unable to load your
organization's managed settings", so the first session never started. Retry
on the current client when the acquired one is stopped or replaced.

The Dev Container smoke test now keeps the CI machine's proxy out of the
container: its mock CAPI host only resolves inside the container.

Co-authored-by: Copilot <[email protected]>
Christof Marti (chrmarti) added a commit that referenced this pull request Nov 2, 2026
…s lookups (#345516)

Follow-up to #345225.

An Agent Host in WSL or a local container asks its client for Kerberos
tickets for its proxy. The client only issues them for proxies it points
the Agent Host at, and remembered only the proxies the Agent Host
resolved through it. Any other lookup resolved the system proxy for
GitHub Copilot again: an IPC to the main process and a PAC evaluation in
Electron, once per new proxied connection. That happens, for example,
after a window reconnects. The Agent Host keeps the proxy it cached from
the earlier client, and the Copilot runtime keeps the `HTTPS_PROXY` it
was started with, so the new client never resolves that proxy itself.

## Changes

- The client remembers the proxies it resolved for GitHub Copilot like
those it resolved for the Agent Host. Later lookups for them need no
proxy resolution. Proxies from the `http.proxy` setting need no IPC and
stay uncached, so a change to that setting still applies right away.
- A declined proxy is logged once, rather than once per connection.

## How to test

On Windows, behind a proxy that requires Kerberos, connect the Agents
window to a WSL Agent Host and start a Copilot session. Reload the
window and continue the session. The Agent Host's requests through the
proxy keep working, and the renderer no longer resolves the proxy for
each new proxied connection.

## Validation

- `scripts\test.bat --reporter dot --run
src\vs\platform\agentHost\test\browser\agentHostClientProxy.test.ts
--run
src\vs\platform\agentHost\test\electron-browser\agentHostProtocolClient.test.ts`:
400 passing. `only issues tickets for the proxies configured or resolved
for GitHub Copilot` now expects two proxy resolutions for five lookups
instead of four; the new `logs a declined proxy once` test covers the
log.
- `npm run typecheck-client`: passed. ESLint on the changed files:
passed.
Christof Marti (chrmarti) added a commit that referenced this pull request Nov 2, 2026
Follow-up to #345225, which added the WSL Kerberos proxy smoke tests
without running them in CI. CI and smoke test changes only; nothing here
is needed on `release/1.145`.

## Changes

- **Pinned server.** `test/smoke/wslDevContainer.ps1` pins Insiders
`67710841ad0` (instead of `0469440342`), whose Agent Host has the client
proxy, Kerberos and certificate support. It installs `krb5-kdc`,
`krb5-admin-server`, `squid-openssl` and `openssl` into the CI
distribution, with a `policy-rc.d` that keeps the packages from starting
their services. The WSL Dev Container suite uses the same server.
- **Which suites run where.** A packaged server only accepts a packaged
client of its own commit, so the editor window suite cannot run against
the pinned server from source or from another build:
- GitHub (`pr-win32-test.yml`, smoke shard 1): after the main Electron
smoke run, the runner runs the Agents Window suite (`-Suites
AgentsWindow`).
- Azure (`product-build-win32-test.yml`, Windows x64 Smoke job): a new
`smoke-wsl-kerberos-proxy` checkpoint runs both suites with the packaged
client. The editor window suite uses the Linux server of the same run's
Linux x64 compile job: the job waits for `compilation_linux_x64`
(normally already published before the Windows smoke job starts),
downloads only `builds.tar.gz`, and `wslDevContainer.ps1 -Operation
AddServer` extracts the server into the distribution. Runs without a
Linux x64 product build (CI builds, Windows-only builds) run only the
Agents Window suite.
- The WSL setup now runs while either `smoke-electron` or
`smoke-wsl-kerberos-proxy` still has to pass, and is cleaned up after
both. The new ID is added to the Windows x64 Smoke jobs of all three
pipelines and to the checkpoint lists and template tests.
- **Runner.** `-Suites All|AgentsWindow|EditorWindow` selects the
suites. The runner moves an earlier `.build/logs/smoke-tests-electron`
aside during its run and files its own smoke logs under
`.build/logs/agents-window-wsl-kerberos-proxy`, so the main smoke run's
logs survive. Likewise, it keeps the main run's JUnit report and files
its own as `*-desktop-smoke-tests-wsl-kerberos-proxy-results.xml`, so
`PublishTestResults` gets both.
- **Fixture.** The editor window suite fails early with a clear message
when a packaged client and the server have different commits, instead of
timing out.

## How to test

Locally, on Windows with an elevated PowerShell, emulate the CI job: run
`test\smoke\wslDevContainer.ps1` with `GITHUB_WORKSPACE`,
`GITHUB_RUN_ID`, `GITHUB_RUN_ATTEMPT` and `GITHUB_OUTPUT` set, then
`test\smoke\scripts\run-agents-window-wsl-kerberos-proxy.ps1
-Distribution <distro> -WslServerPath /opt/vscode-smoke-server`, with
`--build <Insiders 6771084 client>` for both suites or `-Suites
AgentsWindow` from source, and clean up with `-Operation Cleanup`.

## Validation

Rebased from `release/1.145` onto `main`; the only conflict was the
README's npm commands (now pnpm). The runner already calls `pnpm.cmd` on
`main`.

On `main`:
- `node --test build/lib/test/testCheckpointTemplates.test.ts
build/lib/test/testCheckpoint.test.ts`: 29 passing, 1 failing. The
failure, `only the product test steps use checkpoints`, compares `\` and
`/` path separators and fails on Windows without this change too.
- `pnpm run typecheck` in `build`: passed. `pnpm run compile` in
`test/smoke`: passed. `pnpm run eslint` on the changed TypeScript files:
passed.
- The JUnit report handling, simulated with an earlier report, a rerun
and a run without a report: the main and browser reports survive and the
Kerberos run's report gets its own name.
- GitHub (`90bf37b2dab`): all checks passed; the Kerberos step of
Electron smoke shard 1 passed the Agents Window suite ("1 passing").
- Azure build
[491824](https://dev.azure.com/monacotools/Monaco/_build/results?buildId=491824)
(`90bf37b2dab`, Windows x64 and Linux x64, tests on, no publishing): all
23 jobs passed. In the Windows x64 Smoke job, the Kerberos step passed
both suites with the packaged client and the Linux x64 server of the
same run ("2 passing", 42 s), and "Publish Tests Results" published two
test runs: the main Electron smoke run (91 results) and the Kerberos run
(2).

Before the rebase, on `release/1.145` with the same scripts (npm instead
of pnpm):
- Local CI emulation: `wslDevContainer.ps1` provisioned the Ubuntu 22.04
distribution with the new packages and pinned server. From source, the
Agents Window suite passed; the editor window suite failed with
"Unauthorized client refused", which led to `-Suites AgentsWindow` for
GitHub. With the Insiders `67710841ad0` client (`--build`), both suites
passed, and the script verified the PAC fetch, the
Kerberos-authenticated tunnels through Squid and the KDC tickets issued
to Windows. Cleanup removed the distribution and the Windows
configuration.
- GitHub: the Kerberos step of Electron smoke shard 1 passed the Agents
Window suite ("1 passing"). Earlier runs found the missing checkpoint
variables in `testCheckpoint.test.ts` and that the CI image's JDK
`klist` shadows Windows' `klist.exe`, so the runner now calls the latter
by path.
- Azure build
[491806](https://dev.azure.com/monacotools/Monaco/_build/results?buildId=491806)
(Windows x64 and Linux x64, tests on, no publishing): all 23 jobs
passed. In the Windows x64 Smoke job, the Linux x64 server steps took
about 35 s together (wait, download, `AddServer`), and the Kerberos step
passed both suites with the packaged client and the Linux x64 server of
the same run. Copilot's review then found that this run replaced the
main smoke run's JUnit report, which the last commit fixes.
Christof Marti (chrmarti) added a commit that referenced this pull request Nov 5, 2026
…ed for Kerberos lookups (#345567)

Cherry-pick of #345516 from `release/1.145`.

Follow-up to #345225.

An Agent Host in WSL or a local container asks its client for Kerberos
tickets for its proxy. The client only issues them for proxies it points
the Agent Host at, and remembered only the proxies the Agent Host
resolved through it. Any other lookup resolved the system proxy for
GitHub Copilot again: an IPC to the main process and a PAC evaluation in
Electron, once per new proxied connection. That happens, for example,
after a window reconnects. The Agent Host keeps the proxy it cached from
the earlier client, and the Copilot runtime keeps the `HTTPS_PROXY` it
was started with, so the new client never resolves that proxy itself.

## Changes

- The client remembers the proxies it resolved for GitHub Copilot like
those it resolved for the Agent Host. Later lookups for them need no
proxy resolution. Proxies from the `http.proxy` setting need no IPC and
stay uncached, so a change to that setting still applies right away.
- A declined proxy is logged once, rather than once per connection.

## How to test

On Windows, behind a proxy that requires Kerberos, connect the Agents
window to a WSL Agent Host and start a Copilot session. Reload the
window and continue the session. The Agent Host's requests through the
proxy keep working, and the renderer no longer resolves the proxy for
each new proxied connection.

## Validation

- `scripts\test.bat --reporter dot --run
src\vs\platform\agentHost\test\browser\agentHostClientProxy.test.ts
--run
src\vs\platform\agentHost\test\electron-browser\agentHostProtocolClient.test.ts`:
400 passing. `only issues tickets for the proxies configured or resolved
for GitHub Copilot` now expects two proxy resolutions for five lookups
instead of four; the new `logs a declined proxy once` test covers the
log.
- `npm run typecheck-client`: passed. ESLint on the changed files:
passed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants