Skip to content

fix(vector_io): propagate search errors instead of returning empty results - #6093

Merged
cdoern merged 3 commits into
ogx-ai:mainfrom
derekhiggins:fix/surface-vector-store-search-errors
Jun 15, 2026
Merged

fix(vector_io): propagate search errors instead of returning empty results#6093
cdoern merged 3 commits into
ogx-ai:mainfrom
derekhiggins:fix/surface-vector-store-search-errors

Conversation

@derekhiggins

@derekhiggins derekhiggins commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The catch-all except Exception in openai_search_vector_store was silently swallowing backend errors and returning empty results with HTTP 200
  • Clients had no way to distinguish "no matching documents" from "the search failed"
  • This masked bugs like the milvus-lite 3.0 chunk_content KeyError (feat(benchmarking): add Bayesian model fitting and CI workflow #6089), where file_search appeared to work but retrieval silently returned nothing
  • Now re-raises the exception so it surfaces as a 500 to the client
  • Also fixes test_openai_vector_store_with_chunks which was passing filters={"topic": "ai"} (the old shorthand format) instead of the typed format {"type": "eq", "key": "topic", "value": "ai"} required since feat: Enable Filters in OpenAI Search API #4471. The error was silently swallowed, and the assertion loop over empty results never executed, so the test appeared to pass.

Closes #6092

Test plan

  • Added unit test test_search_vector_store_propagates_backend_errors that verifies a KeyError from the backend propagates to the caller
  • Fixed test_openai_vector_store_with_chunks filter format so it actually exercises the filter path
  • Reproduced locally with milvus-lite 3.0: before the fix, search returns 200 with empty results; after, returns 500

…sults

The catch-all exception handler in openai_search_vector_store was
silently swallowing backend errors and returning an empty result set
with HTTP 200. This made it impossible for clients to distinguish
between "no matching documents" and "the search failed", masking
bugs like the milvus-lite 3.0 chunk_content KeyError.

Closes ogx-ai#6092

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Derek Higgins <derekh@redhat.com>
…e_with_chunks

The test was passing a plain dict filter without a 'type' field, which
was silently failing due to the catch-all exception handler returning
empty results. The assertion loop never ran, so it appeared to pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Derek Higgins <derekh@redhat.com>
@cdoern
cdoern added this pull request to the merge queue Jun 12, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 12, 2026
@cdoern
cdoern added this pull request to the merge queue Jun 12, 2026
@cdoern

cdoern commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

@Mergifyio backport release-1.1.x

@mergify

mergify Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

backport release-1.1.x

✅ Backports have been created

Details

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 12, 2026
@mattf
mattf added this pull request to the merge queue Jun 13, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 13, 2026
@cdoern
cdoern added this pull request to the merge queue Jun 14, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 14, 2026
@cdoern
cdoern added this pull request to the merge queue Jun 15, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 15, 2026
Qdrant collections are created lazily on first insert, so searching a
vector store that has never had chunks added raises a 404. Handle this
by checking collection existence and returning empty results instead.

Co-Authored-By: Charlie Doern <cdoern@redhat.com>
Signed-off-by: Derek Higgins <derekh@redhat.com>
@derekhiggins
derekhiggins force-pushed the fix/surface-vector-store-search-errors branch from 757ec61 to 3879640 Compare June 15, 2026 14:43
@cdoern
cdoern enabled auto-merge June 15, 2026 14:44
@cdoern
cdoern added this pull request to the merge queue Jun 15, 2026
Merged via the queue into ogx-ai:main with commit 6acf940 Jun 15, 2026
53 checks passed
cdoern added a commit that referenced this pull request Jun 15, 2026
…sults (backport #6093) (#6117)

## Summary
- The catch-all `except Exception` in `openai_search_vector_store` was
silently swallowing backend errors and returning empty results with HTTP
200
- Clients had no way to distinguish "no matching documents" from "the
search failed"
- This masked bugs like the milvus-lite 3.0 `chunk_content` KeyError
(#6089), where file_search appeared to work but retrieval silently
returned nothing
- Now re-raises the exception so it surfaces as a 500 to the client
- Also fixes `test_openai_vector_store_with_chunks` which was passing
`filters={"topic": "ai"}` (the old shorthand format) instead of the
typed format `{"type": "eq", "key": "topic", "value": "ai"}` required
since #4471. The error was silently swallowed, and the assertion loop
over empty results never executed, so the test appeared to pass.

Closes #6092

## Test plan
- Added unit test `test_search_vector_store_propagates_backend_errors`
that verifies a `KeyError` from the backend propagates to the caller
- Fixed `test_openai_vector_store_with_chunks` filter format so it
actually exercises the filter path
- Reproduced locally with milvus-lite 3.0: before the fix, search
returns 200 with empty results; after, returns 500<hr>This is an
automatic backport of pull request #6093 done by
[Mergify](https://mergify.com).

Signed-off-by: Derek Higgins <derekh@redhat.com>
Co-authored-by: Derek Higgins <derekh@redhat.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Charlie Doern <cdoern@redhat.com>
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.

Vector store search silently returns empty results on backend errors

3 participants