litellm/tests/unit/rust_bridge/host
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
..
routes 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_cache.py feat(messages): serve azure ai foundry messages on rust only (#51721) 2026-11-14 13:40:38 -08:00
test_cache_invalidation.py refactor(auth_cache_invalidation): move the invalidation channel to the native client (#51135) 2026-11-21 18:58:27 +09:00
test_callbacks_legacy_python.py feat(cost): price native /v1/messages calls in the Rust route and hand the receipt to logging (#52624) 2026-11-23 16:27:46 -08:00
test_model_capabilities.py feat(messages): serve bedrock invoke messages on rust only (#51330) 2026-11-15 16:58:31 -08:00
test_model_cost.py feat(cost): price Claude token calls, budget holds and auth price checks in Rust (#52484) 2026-11-23 22:00:28 +00:00
test_preflight.py chore: move workspace packages under litellm (#51000) 2026-11-12 04:19:57 +00:00
test_redis_credentials.py feat(redis): extend the native Redis foundation for the store families (#50169) 2026-11-06 12:30:07 +09:00
test_redis_events.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_route_groups.py refactor(auth): decide route rules in Rust (#51531) 2026-11-16 18:55:32 +09:00
test_secret_manager.py refactor(rust_bridge): route every Rust-to-Python call through host modules (#50822) 2026-11-11 01:57:54 +00:00
test_settings.py feat(bedrock): derive STS session tags and session name from caller identity (#52978) 2026-11-19 17:11:09 -08:00