Repository navigation
agentHost: Retry session config after a proxy restarts the client - #345546
Ladislau Szomoru (lszomoru) merged 1 commit into
Conversation
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]>
There was a problem hiding this comment.
🟢 Approval recommended
No active review findings remain to block approval.
No open issues 🎉
What changed in this PR
Fixes a session-startup race in Agent Host when proxy resolution restarts the Copilot client while managed settings are loading.
Changes:
- Retries chat configuration resolution across up to three SDK client attempts when the client is stopped or replaced.
- Adds a regression test for a proxy-triggered restart during managed-settings resolution.
- Disables client proxy forwarding in the local Dev Container smoke suite so the container-only mock host remains reachable.
No actionable findings remain. The PR reports passing targeted unit tests, type checking, and linting; the Dev Container smoke test was not run locally.
| File | Description |
|---|---|
test/smoke/src/areas/agentsWindow/agentsWindow.test.ts |
Disables local proxy forwarding for the Dev Container fixture. |
src/vs/platform/agentHost/test/node/copilotAgent.test.ts |
Tests managed-settings recovery after a proxy-triggered client restart. |
src/vs/platform/agentHost/node/copilot/copilotAgent.ts |
Adds bounded retries when managed-settings resolution loses its SDK client. |
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 |
64a255f
into
release/1.145
Fixes the
Agents Window (Dev Container AgentHost) > Starts a session in a Dev Containersmoke test failure in build 491729. Follow-up to #345225.Cause
The
mainbuild has no published CLI for its commit, so the container's Agent Host falls back to the latest insider:release/1.145@ 6771084, which includes #345225. That Agent Host resolves proxies through the client, and the Linux CI agent has an egress proxy (PROXY 10.1.0.30:18080):CopilotClientwas starting, so it was restarted right after the start.resolveSessionConfigthen resolved managed settings on the stopped client:Unable to load your organization's managed settings. Please try again. Pending response rejected since connection got disposed. The session was never created. Any user behind a proxy can hit this on their first Dev Container or WSL session.vscode-smoke.testonly resolves inside the container (--add-host), so the CI machine's proxy returns 502 Bad Gateway for it.Changes
CopilotAgent.resolveChatConfigretries managed-settings resolution on the current client when the acquired client is stopped or replaced before the query settles (bounded to 3 clients). It still fails when the client is unchanged, e.g. for a superseded account.http.useLocalProxyConfiguration: false, keeping the CI machine's proxy out of the container.Note:
mainruns its own copy of the smoke test, so the test change also needs to land there; the product fix reachesmainbuilds once a new 1.145 insider is published.Validation
.\scripts\test.bat --run src\vs\platform\agentHost\test\node\copilotAgent.test.ts --grep "managed settings|proxy|Proxy": 47 passing.Your account or organization settings changed while loading. Please try again.; passes with it.npm run typecheck-client: passed.npm run eslint -- <changed files>: passed.