fix: clean up stale vectors on directory deletion and add Qdrant collection alias#12116
Draft
roomote-v0[bot] wants to merge 1 commit intomainfrom
Draft
fix: clean up stale vectors on directory deletion and add Qdrant collection alias#12116roomote-v0[bot] wants to merge 1 commit intomainfrom
roomote-v0[bot] wants to merge 1 commit intomainfrom
Conversation
…ection alias - Detect directory deletions in FileWatcher by checking cache for child paths, queuing all children for vector deletion - Add human-readable Qdrant collection alias based on workspace folder name - Add tests for both features Addresses #12115
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.
Related GitHub Issue
Closes: #12115
Description
This PR attempts to address Issue #12115. Feedback and guidance are welcome.
Two changes:
Directory deletion handling in FileWatcher: When a directory is deleted, VSCode's FileSystemWatcher with extension-specific glob patterns does not fire individual
onDidDeleteevents for each file inside it. ThehandleFileDeletedmethod now detects directory deletions by checking the cache manager for any files whose paths start with the deleted path prefix, and queues them all for vector deletion. This ensures stale vectors are cleaned up promptly rather than persisting until a full re-index.Qdrant collection alias: After collection initialization, a human-readable alias is created using the sanitized workspace folder name (e.g.,
my-project-> alias forws-fc1843e42d391b4f). This allows external tools to discover and query the collection without reverse-engineering the hashed naming scheme. Alias creation is non-fatal -- failures are logged but do not block initialization.Test Procedure
file-watcher.spec.tscovering directory deletion (child paths queued), single file deletion, and deletion of paths not in cacheqdrant-client.spec.tscovering alias creation during init, graceful failure handling, and alias name sanitizationcd src && pnpm vitest run services/code-index/processors/__tests__/file-watcher.spec.tscd src && pnpm vitest run services/code-index/vector-store/__tests__/qdrant-client.spec.tsPre-Submission Checklist
Screenshots / Videos
N/A -- backend-only changes, no UI impact.
Documentation Updates
No documentation updates required.
Interactively review PR in Roo Code Cloud