agentHost: destroy Copilot sessions concurrently - #333946
Draft
Christof Marti (chrmarti) wants to merge 1 commit into
Draft
agentHost: destroy Copilot sessions concurrently#333946Christof Marti (chrmarti) wants to merge 1 commit into
Christof Marti (chrmarti) wants to merge 1 commit into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Christof Marti (chrmarti)
requested review from
Sandeep Somavarapu (sandy081)
and
a balanced review from Copilot
September 2, 2026 07:45
Copilot started reviewing on behalf of
Christof Marti (chrmarti)
September 2, 2026 07:46
View session
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused implementation preserves lifecycle ordering and includes effective regression coverage.
Review tier: Balanced
Findings: None
What changed in this PR
Runs independent Copilot SDK session teardown concurrently while retaining client shutdown ordering.
Changes:
- Destroys all live sessions with
Promise.all. - Adds regression coverage proving both disconnects start before completion.
| File | Description |
|---|---|
src/vs/platform/agentHost/node/copilot/copilotAgent.ts |
Parallelizes live-session destruction before stopping the shared client. |
src/vs/platform/agentHost/test/node/copilotAgent.test.ts |
Tests concurrent session teardown during shutdown. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Sandeep Somavarapu (sandy081)
requested review from
roblourens
and removed request for
Sandeep Somavarapu (sandy081)
September 2, 2026 13:30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Agent Host shutdown has a 1.5 second provider budget, but the Copilot provider destroyed each live SDK session serially. With several restored sessions, their disconnect latency accumulated and repeatedly produced:
Destroy independent live sessions concurrently while preserving the existing ordering that waits for all sessions before stopping the shared client.
Adds a regression test that blocks two session disconnects and verifies both start before either completes.
Validation:
npm run transpile-client./scripts/test.sh --run src/vs/platform/agentHost/test/node/copilotAgent.test.ts --grep "shutdown"(6 passing)git diff --checkThe serialized teardown was introduced in #329633.