Skip to content

Realtime watcher self-triggers on .qdrant_code_embeddings (infinite loop) #286

@mike-lsadigital

Description

@mike-lsadigital

Bug Description

The realtime watcher (realtime_updater.py) enters an infinite loop when Qdrant embeddings storage is inside the watched repository tree. The watcher detects .qdrant_code_embeddings/storage.sqlite as a code change, triggering a full recalculation (~7 min), which writes new embeddings, which triggers another detection — ad infinitum.

Environment

  • macOS (Apple Silicon) with Docker
  • PollingObserver for Docker volume compatibility
  • graph-code v0.0.38 (also confirmed on v0.0.40)

Evidence

From container logs after 7 days of uptime:

  • grep -c "Change detected" logs860 detections
  • grep -c "Recalculating all" logs859 full recalculations
  • storage.sqlite detected as changed 20+ times on a single day

Root Cause

IGNORE_PATTERNS in constants.py does not include .qdrant_code_embeddings. The _is_relevant() filter in realtime_updater.py only checks against this frozenset, so Qdrant files pass through.

Note that .qdrant_code_embeddings is already in .gitignore, confirming it's recognized as generated output.

Proposed Fix

  1. Add .qdrant_code_embeddings to IGNORE_PATTERNS in constants.py
  2. Consider loading .cgrignore in the watcher (related: .cgrignore not pulled as a default check #277)

Happy to submit a PR if desired.

Related

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions