Repository navigation
fix: skip package refresh for deleted environments - #1833
Merged
Eleanor Boyd (eleanorjboyd) merged 1 commit intoSep 30, 2026
Merged
Eleanor Boyd (eleanorjboyd) merged 1 commit into
Eleanor Boyd (eleanorjboyd) merged 1 commit into
Conversation
Dmitriy Vasyura (dmitrivMS)
previously approved these changes
Sep 28, 2026
Deleting and recreating a virtual environment triggered the package watcher, which ran `pip list` against the already-removed interpreter and surfaced an "Error refreshing packages" notification. The failure was an expected consequence of the deletion, not an actionable problem. The watcher now verifies the environment executable exists before refreshing. While the executable is missing it retries on the existing debounce interval for up to 30 seconds, so package state is still refreshed once the recreated environment appears. Genuine stat and refresh failures continue to be logged. Also teaches `isFileNotFoundError` to recognize VS Code `FileSystemError` missing-entry codes in addition to Node's `ENOENT`. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Eleanor Boyd (eleanorjboyd)
force-pushed
the
agents/fix-package-refresh-deleted-env
branch
from
September 28, 2026 20:04
7c07d5a to
855976a
Compare
Vritant Bhardwaj (vritant24)
approved these changes
Sep 28, 2026
Eleanor Boyd (eleanorjboyd)
marked this pull request as draft
September 28, 2026 20:39
Eduardo Villalpando Mello (edvilme)
approved these changes
Sep 30, 2026
Eleanor Boyd (eleanorjboyd)
marked this pull request as ready for review
September 30, 2026 16:09
Eleanor Boyd (eleanorjboyd)
merged commit Sep 30, 2026
c8bb80b
into
microsoft:main
45 of 46 checks passed
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.
Fixes #1824
Problem
Deleting and recreating a virtual environment (for example
make clean-venvfollowed bymake venv) surfaced an "Error refreshing packages" notification.Explanation
The package watcher observes
site-packages. Deleting the environment fires delete events, which schedule a debounced refresh. That refresh then ranpip listagainst the interpreter that had just been removed, so the failure was an expected consequence of the deletion rather than an actionable problem — but it was reported to the user as an error.Fix
watchPackageChangesForEnvironmentnow verifies the environment executable exists before refreshing.