litellm/tests/unit/rust_bridge
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
..
host fix(ocr): report an unreachable document URL as a 400, not a provider 500 (#54215) 2026-11-26 07:56:58 +00:00
messages feat(messages): serve bedrock invoke messages on rust only (#51330) 2026-11-15 16:58:31 -08:00
ocr refactor(rust-bridge): require the native extension (#48852) 2026-10-28 13:16:56 -07:00
trace
__init__.py
AGENTS.md refactor(rust-bridge): decide native routing in the catalog, drop the bypass predicates (#46750) 2026-10-20 15:06:24 -07:00
native_route_wheel_test.py fix(bedrock): omit system prompt from audio transcription and report its token usage (#41565) 2026-10-28 19:23:15 -07:00
stubtest.ini
test_bindings.py refactor(rust-bridge): require the native extension (#48852) 2026-10-28 13:16:56 -07:00
test_catalog.py feat(messages): serve bedrock claude_platform messages on rust only (#52681) 2026-11-19 14:34:02 -08:00
test_clickhouse.py
test_configuration.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_detectors.py feat(messages): serve anthropic messages on rust only (#51119) 2026-11-12 00:07:20 +00:00
test_execution.py refactor(rust-bridge): return an unstarted Execution from native entrypoints and drive it in Python (#46299) 2026-10-14 17:50:44 -07:00
test_failures.py
test_fork_guard.py refactor(rust-bridge): require the native extension (#48852) 2026-10-28 13:16:56 -07:00
test_logger.py refactor(rust_bridge): send every Rust log line through one subscriber (#53738) 2026-11-23 17:53:54 +09:00
test_public_call.py fix(rust): run native async calls through python's async wrapper steps (#50423) 2026-11-10 00:24:20 +00:00
test_runtime.py feat(messages): serve anthropic messages on rust only (#51119) 2026-11-12 00:07:20 +00:00
test_token_counter.py fix(proxy): count the request's tool_choice on the token count routes (#51133) 2026-11-14 07:53:27 -05:00
test_tokenizer.py
test_verify_linux_native_wheel.py chore: move scripts and runtime sources under litellm (#51006) 2026-11-12 04:19:57 +00:00