fix: preserve pgvector None sentinel on zero top_k

query_external_vector_document_ids must return None when on the
pgvector path before applying the top_k<=0 empty-list guard.
This commit is contained in:
Aakash Kattelu 2026-08-26 16:54:25 -04:00
parent 8bd795c50e
commit 1fa9930d41
1 changed files with 3 additions and 3 deletions

View File

@ -228,12 +228,12 @@ async def query_external_vector_document_ids(
empty list when the external store has no results,
or None when the pgvector (DB-only) path should be used instead.
"""
if top_k <= 0:
return []
if _uses_pgvector():
return None
if top_k <= 0:
return []
external_vector_store = get_external_vector_store()
if external_vector_store is None:
return []