Repository navigation
Fix duplicate Conda environments after restart - #1939
Merged
Stella Huang (StellaHuang95) merged 1 commit intoOct 20, 2026
Merged
Stella Huang (StellaHuang95) merged 1 commit into
Stella Huang (StellaHuang95) merged 1 commit into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 965f9204-0368-49bf-a79d-6243a3e10ed6
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused changes address the reported race with deterministic regression coverage and no identified blocking issues.
No open issues 🎉
What changed in this PR
Fixes duplicate Conda environments after restart by coordinating inventory rebuilds and reusing canonical environment objects for persisted selections.
Changes:
- Serializes startup discovery and explicit refreshes.
- Deduplicates resolved selections by normalized environment path.
- Adds deterministic regression tests for both persistence scopes, refresh events, and path variants.
| File | Description |
|---|---|
| src/test/managers/conda/condaEnvManager.refreshRace.unit.test.ts | Tests concurrent restoration, refresh ordering, and selection identity. |
| src/managers/conda/condaEnvManager.ts | Queues inventory rebuilds and canonicalizes resolved environments. |
Review effort: Balanced
Contributor
|
🔒 Automated review in progress — Rich Chiodo (@rchiodo) is auto-reviewing this PR. |
Rich Chiodo (rchiodo)
approved these changes
Oct 20, 2026
Rich Chiodo (rchiodo)
left a comment
Contributor
There was a problem hiding this comment.
Approved via Review Center.
Bill Schnurr (bschnurr)
approved these changes
Oct 20, 2026
Bill Schnurr (bschnurr)
left a comment
Member
There was a problem hiding this comment.
Approved via Review Center.
Heejae Chang (heejaechang)
approved these changes
Oct 20, 2026
Heejae Chang (heejaechang)
left a comment
There was a problem hiding this comment.
Approved via Review Center.
Stella Huang (StellaHuang95)
merged commit Oct 20, 2026
4f44915
into
microsoft:main
59 of 60 checks passed
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.
Summary
Validation
npm run lintnpm run compile-testsnpm run unittest(3,300 passing, 9 pending)npm run compilegetEnvironment()and explicit refresh triggered concurrently; one underlying object remained and selection was restoredsys.prefixand executableFixes #1870