Skip to content

fix: reject empty/whitespace search queries before embedding - #15

Merged
royalpinto007 merged 2 commits into
AgentPostmortem:mainfrom
Hbrehman:fix/reject-empty-search-query
Sep 6, 2026
Merged

fix: reject empty/whitespace search queries before embedding#15
royalpinto007 merged 2 commits into
AgentPostmortem:mainfrom
Hbrehman:fix/reject-empty-search-query

Conversation

@Hbrehman

@Hbrehman Hbrehman commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Reject empty/whitespace-only query values in search() before any embedding or Qdrant call. Blank queries can embed to a degenerate vector and return arbitrary-looking hits.

Fixes #11

Why

Same failure mode as empty tenant_id (see #9): silent bad input produces plausible wrong results. Validation belongs at the search boundary.

Test plan

  • Parametrized test proves embed_dense / embed_sparse / query_points are never called for empty/whitespace queries
  • Query with internal spaces still works after strip
  • pytest tests/test_search.py -q (please run in CI / locally)

@royalpinto007
royalpinto007 merged commit 1d207e8 into AgentPostmortem:main Sep 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

search() runs empty/whitespace queries instead of rejecting them

2 participants