Skip to content

[cherry-pick] agentHost: Remember the Copilot proxies a client resolved for Kerberos lookups - #345567

Merged
Christof Marti (chrmarti) merged 1 commit into
mainfrom
cherry-pick/345516
Nov 5, 2026
Merged

Christof Marti (chrmarti) merged 1 commit into
mainfrom
cherry-pick/345516

Conversation

@vs-code-engineering

Copy link
Copy Markdown
Contributor

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.

Copilot AI balanced review requested due to automatic review settings November 2, 2026 13:58
@vs-code-engineering vs-code-engineering Bot added the cherry-pick-artifact Auto-generated cherry-pick PR label Nov 2, 2026

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 are reported for the proxy-host caching and deduplicated Kerberos logging changes.

No open issues 🎉

What changed in this PR

This cherry-pick reduces repeated proxy resolution for Agent Host Kerberos lookups, particularly after reconnecting to WSL or a local container.

Changes:

  • Remembers system proxy hosts resolved for GitHub Copilot, while leaving http.proxy settings uncached.
  • Logs declined Kerberos lookups once per host.
  • Updates tests to verify fewer proxy resolutions and deduplicated logging.
File Description
src/​vs/​platform/​agentHost/​test/​browser/​agentHostClientProxy.test.ts Updates resolution-count expectations and adds declined-host logging coverage.
src/​vs/​platform/​agentHost/​browser/​agentHostClientProxy.ts Caches Copilot-resolved proxy hosts and deduplicates decline logs.

Review effort: Balanced

@chrmarti
Christof Marti (chrmarti) merged commit c266d86 into main Nov 5, 2026
56 checks passed
@chrmarti
Christof Marti (chrmarti) deleted the cherry-pick/345516 branch November 5, 2026 13:05
@vs-code-engineering vs-code-engineering Bot added this to the 1.145.1 milestone Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick-artifact Auto-generated cherry-pick PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants