Commit 6acf940
fix(vector_io): propagate search errors instead of returning empty results (ogx-ai#6093)
## 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
(ogx-ai#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 ogx-ai#4471. The error was silently swallowed, and the assertion loop
over empty results never executed, so the test appeared to pass.
Closes ogx-ai#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
---------
Signed-off-by: Derek Higgins <derekh@redhat.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Charlie Doern <cdoern@redhat.com>1 parent 1a0fe23 commit 6acf940
4 files changed
Lines changed: 47 additions & 9 deletions
File tree
- src/ogx/providers
- remote/vector_io/qdrant
- utils/memory
- tests
- integration/vector_io
- unit/providers/vector_io
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
136 | 142 | | |
137 | 143 | | |
138 | 144 | | |
| |||
184 | 190 | | |
185 | 191 | | |
186 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
187 | 199 | | |
188 | 200 | | |
189 | 201 | | |
| |||
264 | 276 | | |
265 | 277 | | |
266 | 278 | | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
267 | 285 | | |
268 | 286 | | |
269 | 287 | | |
| |||
Lines changed: 2 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1121 | 1121 | | |
1122 | 1122 | | |
1123 | 1123 | | |
1124 | | - | |
1125 | | - | |
1126 | | - | |
1127 | | - | |
1128 | | - | |
1129 | | - | |
1130 | | - | |
1131 | | - | |
| 1124 | + | |
| 1125 | + | |
1132 | 1126 | | |
1133 | 1127 | | |
1134 | 1128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3585 | 3585 | | |
3586 | 3586 | | |
3587 | 3587 | | |
3588 | | - | |
| 3588 | + | |
3589 | 3589 | | |
3590 | 3590 | | |
3591 | 3591 | | |
| |||
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
216 | 242 | | |
217 | 243 | | |
218 | 244 | | |
| |||
0 commit comments