Repository navigation
Restore global manager routing after clearing an explicit interpreter - #1977
Closed
Eduardo Villalpando Mello (edvilme) with Copilot wants to merge 3 commits into
Closed
Eduardo Villalpando Mello (edvilme) with Copilot wants to merge 3 commits into
Eduardo Villalpando Mello (edvilme) with Copilot wants to merge 3 commits into
Conversation
Co-authored-by: edvilme <5952839+edvilme@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix global interpreter stale manager issue on clear selection
Restore global manager routing after clearing an explicit interpreter
Nov 4, 2026
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Clearing the global routing override can restore a stale system manager on later automatic resolution and publish environments that do not match global reads.
2 open issues
What changed in this PR
This PR addresses #1976 by separating global selection routing from cached environment ownership, allowing the configured/default manager to take over when an explicit interpreter is cleared.
Changes:
- Track and clear the manager responsible for global selection routing.
- Extend the existing regression test to assert routing returns to the venv manager.
| File | Description |
|---|---|
src/test/features/envManagers.unit.test.ts |
Adds a manager-routing assertion after clearing an explicit selection. |
src/features/envManagers.ts |
Tracks global selection provenance and uses it when choosing the global manager. |
Review effort: Balanced
Co-authored-by: edvilme <5952839+edvilme@users.noreply.github.com>
Eduardo Villalpando Mello (edvilme)
marked this pull request as ready for review
November 4, 2026 00:26
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Superseded operations can overwrite newer selections, while routing resets and lookup failures can leave caches, events, and persisted selections inconsistent.
5 open issues
Revalidate operations after awaited reads to prevent stale cache updates · New Continue reconciling and publishing after per-scope lookup failures · New Resolve routed environment on repeated automatic selections · New Resolve the effective environment after every global unset · New Persist routing reset when the interpreter setting is removed · New
2 resolved since last review
Review effort: Balanced
Comment on lines
+893
to
+896
| const newEnvironment = | ||
| explicitSelection === 'cleared' | ||
| ? await this.getEnvironment(selection.scope) | ||
| : environment; |
Comment on lines
+893
to
+896
| const newEnvironment = | ||
| explicitSelection === 'cleared' | ||
| ? await this.getEnvironment(selection.scope) | ||
| : environment; |
Comment on lines
+931
to
+932
| const newEnvironment = | ||
| explicitSelection === 'cleared' ? await this.getEnvironment(undefined) : environment; |
Comment on lines
+1024
to
+1027
| const newEnv = | ||
| explicitSelection === 'cleared' | ||
| ? await this.getEnvironment(undefined) | ||
| : await manager.get(undefined); |
Comment on lines
+1159
to
+1161
| this.updateGlobalSelectionManager(key, undefined); | ||
| if (key === 'global') { | ||
| this._globalSelectionManagerCleared = true; |
Member
|
🔒 Automated review in progress — Bill Schnurr (@bschnurr) is auto-reviewing this PR. |
Contributor
|
Superseded by #1979 |
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.


Clearing
python.defaultInterpreterPathcould leave global reads routed through the cached environment’s stale owner. The cache remained unchanged and no environment-change event was emitted.Routing provenance
Regression coverage