Skip to content

agentHost: Remember the Copilot proxies a client resolved for Kerberos lookups - #345516

Merged
Christof Marti (chrmarti) merged 1 commit into
release/1.145from
chrmarti/client-proxy-kerberos-host-cache-1.145
Nov 2, 2026
Merged

Christof Marti (chrmarti) merged 1 commit into
release/1.145from
chrmarti/client-proxy-kerberos-host-cache-1.145

Conversation

@chrmarti

Copy link
Copy Markdown
Collaborator

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.

…s lookups

A client sharing its network with an agent host checks every Kerberos
lookup against the proxies it points the agent host at. When the agent
host's proxy was not resolved through this client, for example after a
reconnect, each lookup resolved the system proxy for GitHub Copilot again,
an IPC to the main process and a PAC evaluation per connection. The client
now remembers those proxies like the ones it resolved for the agent host,
and logs a declined proxy once.

Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 2, 2026 10:17

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.

🟢 Approval recommended

No active review issues were identified in the proxy-resolution caching and declined-host log deduplication changes.

No open issues 🎉

What changed in this PR

This follow-up reduces repeated proxy resolution during Kerberos lookups for WSL and local-container Agent Hosts, particularly after a client reconnects.

Changes:

  • Remember system proxies resolved for GitHub Copilot, avoiding repeated IPC and PAC evaluation while leaving http.proxy settings uncached.
  • Log declined Kerberos lookups once per host and update tests for caching and log deduplication.
File Description
src/​vs/​platform/​agentHost/​test/​browser/​agentHostClientProxy.test.ts Updates resolution-count expectations and tests declined-host log deduplication.
src/​vs/​platform/​agentHost/​browser/​agentHostClientProxy.ts Caches Copilot-resolved proxy hosts and logs each declined host once.

Review effort: Balanced

Copilot AI commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

One or more custom setup steps configured for this repository failed during this Copilot code review run:

Setup pnpm

Setup steps run before each review. If the review above is missing context, or no review was posted at all, the failing step above may be the cause. See the workflow run for failure details, fix your setup steps configuration, and re-request a review.

Note

You can configure setup steps for Copilot code review separately from Copilot cloud agent with a copilot-code-review.yml file. Read the docs for details.

@chrmarti
Christof Marti (chrmarti) merged commit 4c66994 into release/1.145 Nov 2, 2026
55 of 56 checks passed
@chrmarti
Christof Marti (chrmarti) deleted the chrmarti/client-proxy-kerberos-host-cache-1.145 branch November 2, 2026 13:56
@vs-code-engineering vs-code-engineering Bot added this to the 1.145.0 milestone Nov 2, 2026
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.

3 participants