Fix Databricks Connect run/debug interpreter split-brain#1912
Merged
Conversation
*Why*: * "Debug with Databricks Connect" started debugpy without a pinned interpreter, so it fell back to the Python extension's folder-level selection — which can differ from the environment used by "run" and by the verification checks — producing a raw ModuleNotFoundError instead of the actionable setup flow. * The cached environment check can reference a previously selected interpreter, because the Python extension doesn't always notify us when the interpreter changes. *What:* * Pin debugpy to the verified interpreter via the debug configuration's `python` attribute. * Resolve the interpreter once in a shared run/debug preflight, so both paths provably use the same executable. * Re-verify the environment before launching when the selected interpreter changed since the cached check (only while connected, since a re-check blocks on the connection). * After an in-flow environment setup, re-check and let the launch proceed instead of aborting and forcing the user to re-trigger. *Verification:* * Added/updated unit tests: debug-config pinning, stale-interpreter re-verification, and proceed-after-setup; RunCommands suite passes (6 tests) in the VS Code test host. * Lint clean on the changed files. Co-authored-by: Isaac
Contributor
Author
|
(EMU) Integration tests run: https://github.com/databricks-eng/eng-dev-ecosystem/actions/runs/27627073249 |
1 similar comment
Contributor
Author
|
(EMU) Integration tests run: https://github.com/databricks-eng/eng-dev-ecosystem/actions/runs/27627073249 |
misha-db
approved these changes
Jun 19, 2026
Contributor
|
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
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.
Why
debugpysession without a pinned interpreter, so debugpy fell back to the Python extension's folder-level selection — which can differ from the environment used by "run" and by the verification checks. With e.g. a system Python 3.9 selected there, debug crashed with a rawModuleNotFoundError: No module named 'databricks'while run worked fine.What
pythonattribute (DatabricksPythonDebugConfiguration.python).resolveDbconnectLaunch), so run and debug provably use the same executable (removes the duplicated preamble).CONNECTED, since a re-check blocks on the connection.Verification
RunCommands.test.ts: debug-config pinning, stale-interpreter re-verification, no-reverify-while-disconnected, and proceed-after-setup. RunCommands suite passes (6 tests) in the VS Code test host.eslintandprettierclean on the changed files.Notes
This is the first of three slices carved out of #1905 (run/debug interpreter split-brain). The pip-less-venv and Python-version-requirement fixes follow in separate PRs.
This pull request and its description were written by Isaac.