fix(vector-sync): use resolved collection name in orphan sweep

The startup sweep was reading settings.qdrant_collection (the raw config
value, default "nextcloud_content") instead of settings.get_collection_name(),
which is what every other vector-sync operation uses. When QDRANT_COLLECTION
is not overridden, get_collection_name() auto-generates a
{deployment-id}-{model-name} name; the sweep was targeting a non-existent
collection and silently returning (0, 0).

Also adds the AsyncQdrantClient type annotation that was missing on
sweep_orphan_placeholders, and renames its parameter from collection_name
to collection to make it clear the value must be the resolved name.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Chris Coutinho
2026-05-22 21:29:48 +02:00
co-authored by Claude Opus 4.7
parent a5cbe91b29
commit c03223a41c
2 changed files with 10 additions and 10 deletions
+3 -4
View File
@@ -1452,15 +1452,14 @@ def get_app(transport: str = "streamable-http", enabled_apps: list[str] | None =
return
try:
qdrant_client = await get_qdrant_client()
swept, kept = await sweep_orphan_placeholders(
qdrant_client, settings.qdrant_collection
)
collection = settings.get_collection_name()
swept, kept = await sweep_orphan_placeholders(qdrant_client, collection)
logger.info(
"vector_sync.orphan_sweep",
extra={
"swept": swept,
"kept": kept,
"collection": settings.qdrant_collection,
"collection": collection,
},
)
except Exception: