Skip to content

prioritize workspace selected env over process.env.CONDA_PREFIX#1398

Merged
eleanorjboyd merged 2 commits intomicrosoft:mainfrom
eleanorjboyd:juicy-flea
Mar 25, 2026
Merged

prioritize workspace selected env over process.env.CONDA_PREFIX#1398
eleanorjboyd merged 2 commits intomicrosoft:mainfrom
eleanorjboyd:juicy-flea

Conversation

@eleanorjboyd
Copy link
Copy Markdown
Member

getCondaForWorkspace() prioritizes process.env.CONDA_PREFIX over the persisted workspace selection (commit b546ac4, PR #1243). This is at src/managers/conda/condaUtils.ts#L85-L87. Fix: swap the order so Memento state is checked first, CONDA_PREFIX is fallback only.

fixes #1347

@eleanorjboyd eleanorjboyd self-assigned this Mar 25, 2026
@eleanorjboyd eleanorjboyd added the bug Issue identified by VS Code Team member as probable bug label Mar 25, 2026
@eleanorjboyd eleanorjboyd requested a review from Copilot March 25, 2026 18:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes getCondaForWorkspace() so a persisted workspace-selected conda environment takes precedence over process.env.CONDA_PREFIX, matching the intended behavior described in issue #1347.

Changes:

  • Reorders getCondaForWorkspace() resolution logic to check persisted workspace selection before falling back to CONDA_PREFIX
  • Adds unit tests covering prioritization, fallback, and undefined cases

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/managers/conda/condaUtils.ts Updates selection logic to prefer persisted workspace env over CONDA_PREFIX fallback
src/test/managers/conda/condaUtils.getCondaForWorkspace.unit.test.ts Adds unit tests validating prioritization and fallback behaviors

TylerLeonhardt
TylerLeonhardt previously approved these changes Mar 25, 2026
@eleanorjboyd eleanorjboyd merged commit 3932262 into microsoft:main Mar 25, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue identified by VS Code Team member as probable bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

selected python environment doesn't stick

4 participants