Skip to content

Conversation

@eleanorjboyd
Copy link
Member

@eleanorjboyd eleanorjboyd commented Feb 3, 2026

Summary

Implements a robust priority chain for interpreter selection that respects user-configured settings, fixes multi-root workspace issues, and prevents unwanted settings.json modifications on startup.

Changes

New Priority Chain (in order):

  1. pythonProjects[] - Project-specific settings (highest priority)
  2. defaultEnvManager - User-configured only (not fallback values)
  3. python.defaultInterpreterPath - Legacy setting support
  4. Auto-discovery - Local venv → System Python (lowest priority)

Key Fixes:

  • Settings now take priority over cached environments
  • python.defaultInterpreterPath is now respected when no explicit defaultEnvManager is configured
  • No automatic settings.json writes on workspace open (only on explicit user actions)
  • User notification when configured settings can't be applied (with "Open Settings" action)

How Cache Fits In

The cache stores previously resolved environments to avoid re-running discovery on every request.

Important: User-configured settings always take priority over cache. The cache is only used as a fallback when:
No user explicitly configured any of the above settings, AND
An environment was previously resolved for that scope
On workspace open, the full priority chain runs fresh for each folder. Cache is populated but not written to settings.json unless the user explicitly selects an interpreter.

Fixes #1145
Fixes #833
Fixes #1124

Testing

29 unit tests covering priority chain, config change listener, multi-root workspaces, and caching behavio

@eleanorjboyd eleanorjboyd self-assigned this Feb 3, 2026
@eleanorjboyd eleanorjboyd added the bug Issue identified by VS Code Team member as probable bug label Feb 3, 2026
@eleanorjboyd eleanorjboyd marked this pull request as ready for review February 3, 2026 05:19
@eleanorjboyd eleanorjboyd enabled auto-merge (squash) February 3, 2026 05:20
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 3, 2026
@eleanorjboyd eleanorjboyd merged commit ee031ad into microsoft:main Feb 3, 2026
7 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

2 participants