Repository navigation
agentHost: Remember the Copilot proxies a client resolved for Kerberos lookups - #345516
Conversation
…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]>
There was a problem hiding this comment.
🟢 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.proxysettings 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
|
One or more custom setup steps configured for this repository failed during this Copilot code review run: 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 |
4c66994
into
release/1.145
…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.
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_PROXYit was started with, so the new client never resolves that proxy itself.Changes
http.proxysetting need no IPC and stay uncached, so a change to that setting still applies right away.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 Copilotnow expects two proxy resolutions for five lookups instead of four; the newlogs a declined proxy oncetest covers the log.npm run typecheck-client: passed. ESLint on the changed files: passed.