debugger: Fall back to cached adapter binaries when offline#50928
Merged
Veykril merged 3 commits intozed-industries:mainfrom Mar 16, 2026
Merged
debugger: Fall back to cached adapter binaries when offline#50928Veykril merged 3 commits intozed-industries:mainfrom
Veykril merged 3 commits intozed-industries:mainfrom
Conversation
Veykril
reviewed
Mar 16, 2026
crates/dap_adapters/src/python.rs
Outdated
| .join("adapter"); | ||
|
|
||
| if let Err(error) = self.maybe_fetch_new_wheel(toolchain, delegate).await { | ||
| if adapter_path.exists() { |
Member
There was a problem hiding this comment.
Suggested change
| if adapter_path.exists() { | |
| if delegate.fs().metadata().is_ok_and(Option::is_some)) { |
and for the go module as well
Contributor
Author
There was a problem hiding this comment.
Thank you
fixed
Contributor
Author
|
sending for CI |
auto-merge was automatically disabled
March 16, 2026 16:17
Head branch was pushed to by a user without write access
3 tasks
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.
The Python (debugpy) and Go (delve-shim-dap) debug adapters unconditionally require network access on every debug session start — even when the adapter binary is already cached locally. This makes the debugger completely unusable offline.
Python: fetch_debugpy_whl → maybe_fetch_new_wheel hits pypi; failure propagates as a fatal error.
Go: install_shim → fetch_latest_adapter_version hits the GitHub API; failure propagates as a fatal error.
CodeLLDB and JavaScript adapters already handle this correctly.
Fix for Python and Go:
Wrap the network fetch in each adapter with a fallback: if the request fails and a previously downloaded adapter exists on disk, log a warning and use the cached version. If no cache exists, the original error propagates unchanged.
Logs after the fix:
Limitations:
The debugger must be run at least once with internet connectivity to populate the cache on disk. This PR does not change that requirement.
Closes #45781
Before you mark this PR as ready for review, make sure that you have:
Release Notes: