litellm/tests/unit/test_router
Julien Parenti d9b88ad3d8
fix(ocr): report an unreachable document URL as a 400, not a provider 500 (#54215)
* fix(ocr): report an unreachable document URL as a 400, not a provider 500

A refused, unresolvable or dropped download of the caller's document_url
had no status, so the proxy reported a 500 naming the provider even
though the provider was never called. Classify it like the existing
download status passthrough, as the caller's 400.

* fix(ocr): keep the download cause in the 400 and retry dropped downloads

Media host failures (DNS, transport, a redirect without a usable Location)
are now request faults in litellm-http, so the OCR bridge answers 400 with
the cause chain instead of a fixed message. A transport failure gets up to
three attempts inside the one download deadline, like Python's media fetch,
since the router no longer retries the 400

* fix(ocr): wait between download retries and retry failed lookups, not connect timeouts

* fix(ocr): answer an unreachable document with a DocumentFetchError the router retries

* fix(ocr): raise a typed native error for an unreachable document

The bridge raises RustDocumentFetchError instead of tagging the exception
with an attribute, and the public DocumentFetchError keeps it as context

* fix(ocr): keep retry counts and debug info on an unreachable document error

* refactor(ocr): import the native module as a whole in the OCR route

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-11-26 07:56:58 +00:00
..
core fix(ocr): report an unreachable document URL as a 400, not a provider 500 (#54215) 2026-11-26 07:56:58 +00:00
__init__.py
test_enforce_model_rate_limits.py fix(gemini): return an error instead of an empty 200 when a Gemini image request gets no image (#29125) 2026-11-25 20:55:23 +00:00
test_io_token_rate_limits.py test(router): pin the clock in the mixed itpm and rpm limit test so a minute rollover cannot move its rpm counter (#54554) 2026-11-25 23:42:12 +00:00
test_router.py fix(streaming): keep OpenRouter chunks that carry only reasoning_details (#48412) 2026-11-25 19:24:55 -08:00
test_router_callback_hook_sequence.py
test_router_endpoints.py fix(proxy): resolve admin oidc api_key references on batch cancel, fine-tuning listing, OCR, /v1/messages and cache prediction (#53678) 2026-11-23 10:11:10 -08:00
test_router_entry_points.py feat(proxy): mixed Codex model picker and LiteLLM routing on native codex routes (#49408) 2026-11-06 11:14:47 -08:00
test_router_facade.py refactor(router): delete the python router core, the rust core is the only core (#50178) 2026-11-05 10:40:46 -08:00
test_router_fallbacks.py fix(router): preserve destination bearer credentials on Anthropic fallbacks (#54271) 2026-11-24 17:12:02 -08:00
test_router_fuzz_regressions_rust_only.py ci(unit): cut unit check time with cheaper per-test resets and fewer non-unit tests (#51864) 2026-11-14 15:41:30 -08:00
test_router_get_deployments.py refactor(router): delete the python router core, the rust core is the only core (#50178) 2026-11-05 10:40:46 -08:00
test_router_helper_utils.py fix(gemini): return an error instead of an empty 200 when a Gemini image request gets no image (#29125) 2026-11-25 20:55:23 +00:00
test_router_host.py ci(unit): cut unit check time with cheaper per-test resets and fewer non-unit tests (#51864) 2026-11-14 15:41:30 -08:00
test_router_max_parallel_requests.py feat(tts)!: stream audio from the provider as it arrives on /v1/audio/speech (#46222) 2026-11-17 15:03:12 +00:00
test_router_provider_endpoints.py feat(redis): serve the proxy's common Redis call with Rust stores (#50170) 2026-11-06 06:01:11 +00:00
test_router_retries.py fix(router): with pre-call checks on, retry a context window error on a group deployment serving another model (#54157) 2026-11-25 10:57:40 +00:00
test_router_surface_check.py chore: move workspace packages under litellm (#51000) 2026-11-12 04:19:57 +00:00
test_router_timeout.py feat(messages): serve bedrock invoke messages on rust only (#51330) 2026-11-15 16:58:31 -08:00
test_router_vector_store_endpoints.py