Skip to content

[BUG] Deleted files leave stale vectors in Qdrant — not cleaned up until full re-index #12115

@pcomte3

Description

@pcomte3

Description

When a file (or directory) is deleted from the workspace, Roo Code does not remove the corresponding vectors from the Qdrant collection. The stale points persist indefinitely until a full re-index is triggered manually.

This means codebase_search can return context from files that no longer exist, which may mislead the AI assistant.

Steps to reproduce

  1. Enable codebase indexing with a local Qdrant instance
  2. Create a file (e.g., decisions/001-test.md) and wait for it to be indexed
  3. Verify it appears in Qdrant via scroll/search
  4. Delete the file (or its parent directory)
  5. Edit and save another file to trigger the incremental file watcher
  6. Query Qdrant — the deleted file's vectors are still present

Expected behavior

Deleted files should have their vectors removed from Qdrant promptly — either via the file system watcher (onDidDelete) or during the next incremental sync pass, not only on a full re-index.

Actual behavior

The _handleBatchDeletions logic in QdrantVectorStore.deletePointsByMultipleFilePaths exists but only runs during a full batch re-index. Incremental file change events (create/update) do not trigger cleanup of deleted files.

Feature request: collection alias at index creation

Additionally, Roo Code creates Qdrant collections with opaque hashed names (e.g., ws-fc1843e42d391b4f), derived from SHA-256(workspacePath).substring(0, 16). This makes it impossible for external tools to discover and query the collection without reverse-engineering the naming scheme.

It would be very useful if Roo Code created a Qdrant alias at index creation time using the workspace folder name (e.g., my-project → alias for ws-fc1843e42d391b4f). This would allow other AI assistants, scripts, and tools to query the same embeddings by a human-readable, stable name — maximizing the value of the index that Roo Code builds.

Qdrant already supports aliases natively via POST /collections/aliases.

Environment

  • Roo Code: v3.52.0
  • VS Code: macOS
  • Qdrant: localhost:6333

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions