Repository navigation
Await Copilot session teardown before config refresh - #327126
Merged
Ulugbek Abdullaev (ulugbekna) merged 1 commit intoJul 23, 2026
Merged
Ulugbek Abdullaev (ulugbekna) merged 1 commit into
Ulugbek Abdullaev (ulugbekna) merged 1 commit into
Conversation
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 6a07710e-3e11-4636-999a-11986503b6cb
Contributor
There was a problem hiding this comment.
Pull request overview
Ensures Copilot configuration refreshes fully disconnect the existing SDK session before resuming the same session ID, preventing stale teardown from terminating the replacement session.
Changes:
- Await SDK session destruction before clearing and resuming the default chat.
- Add deterministic regression coverage for teardown, disposal, resume, and send ordering.
Show a summary per file
| File | Description |
|---|---|
src/vs/platform/agentHost/node/copilot/copilotAgent.ts |
Awaits session teardown during configuration refresh. |
src/vs/platform/agentHost/test/node/copilotAgent.test.ts |
Verifies refresh waits for disconnect completion. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Medium
Giuseppe Cianci (Giuspepe)
approved these changes
Jul 23, 2026
Ulugbek Abdullaev (ulugbekna)
merged commit Jul 23, 2026
3d97fea
into
microsoft:main
29 checks passed
This was referenced Jul 31, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #327125
A structural active-client configuration change refreshes the default Copilot chat by disposing and resuming its SDK session. Disposal previously started
session.disconnect()without awaiting it, allowing the stalesession.destroyrequest to terminate the newly resumed session with the same ID. The next turn then failed withHolder terminated during creation.This change awaits the existing session teardown before clearing and resuming the default chat. Peer chats remain intact. A deterministic regression test holds disconnect open and verifies that dispose, resume, and send occur only after teardown completes.
Testing:
npm run typecheck-clientnpm run valid-layers-checkscripts/test.sh --run src/vs/platform/agentHost/test/node/copilotAgent.test.tscc Connor Peet (@connor4312)