From 33e62db6a2c3a38df4cde728bb495f590a436a39 Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Tue, 14 Jul 2026 11:17:36 +0200 Subject: [PATCH] fix: ensure the tenant-scoped collection in upsert_document_chunks ensure_collection() was called with the raw user string while the upsert targeted get_collection_name(user), creating stray bare-name collections (e.g. 'test_user') and failing the actual upsert when the scoped collection did not exist yet. Co-Authored-By: Claude Fable 5 --- src/clients/qdrant_client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/clients/qdrant_client.py b/src/clients/qdrant_client.py index 93e3d1c..61a20a1 100644 --- a/src/clients/qdrant_client.py +++ b/src/clients/qdrant_client.py @@ -137,7 +137,9 @@ class QdrantClientWrapper: ) collection_name = self.get_collection_name(user) - await self.ensure_collection(user) + # Ensure the tenant-scoped collection (passing the raw user here used + # to create a stray collection named after the bare user string). + await self.ensure_collection(collection_name) points = [] for i, (chunk, embedding) in enumerate(zip(chunks, embeddings)):