Repository navigation
Fix copilot code reference output channel race - #342272
Merged
Dmitriy Vasyura (dmitrivMS) merged 2 commits intoOct 27, 2026
Merged
Dmitriy Vasyura (dmitrivMS) merged 2 commits into
Dmitriy Vasyura (dmitrivMS) merged 2 commits into
Conversation
The code-reference logger created its output channel eagerly during Copilot initialization. When the first authentication token reported that code quoting was disabled, the logger immediately disposed that channel while VS Code could still be registering it asynchronously. The late registration then added resources to an already-disposed store and emitted leak warnings. This is visible when Copilot initializes for an agent request in a profile where code quoting is disabled, including signed-out test profiles. Create the channel only when code quoting is enabled or a citation is actually logged, and cover the lazy lifecycle with a regression test.
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Ulugbek Abdullaev (@ulugbekna)Matched files:
|
Ulugbek Abdullaev (ulugbekna)
approved these changes
Oct 19, 2026
Dmitriy Vasyura (dmitrivMS)
approved these changes
Oct 26, 2026
Aaron Munger (amunger)
approved these changes
Oct 27, 2026
Ingvar Stepanyan (RReverser)
deleted the
fix/copilot-code-reference-output-channel-race
branch
October 28, 2026 15:53
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.
The code-reference logger created its output channel eagerly during Copilot initialization. When the first authentication token reported that code quoting was disabled, the logger immediately disposed that channel while VS Code could still be registering it asynchronously. The late registration then added resources to an already-disposed store and emitted leak warnings. This is visible when Copilot initializes for an agent request in a profile where code quoting is disabled, including signed-out test profiles.
Create the channel only when code quoting is enabled or a citation is actually logged, and cover the lazy lifecycle with a regression test.