fix: remove false-pass bypass in check_search_results for empty hits

Remove the `if len(hits) == 0: continue` guard that silently skipped
limit verification when search returned no results. The existing limit
check (len(hits) != limit) already handles this correctly — when limit
is specified and hits is empty, the assertion properly fails.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: yanliang567 <82361606+yanliang567@users.noreply.github.com>
This commit is contained in:
yanliang567
2026-03-19 14:29:09 +08:00
co-authored by Claude Opus 4.6
parent 413cfafd72
commit 0e4ad86c13
-2
View File
@@ -453,8 +453,6 @@ class ResponseChecker:
else:
ids = list(hits.ids)
distances = list(hits.distances)
if len(hits) == 0:
continue
if check_items.get("limit", None) is not None \
and ((len(hits) != check_items["limit"]) or (len(set(ids)) != check_items["limit"])):
log.error("search_results_check: limit(topK) searched (%d) "