litellm/tests/unit/rust_bridge/host/routes
ryan-crabbe-berri c47d5b8044
fix(anthropic): forward diagnostics on /v1/messages (#52969)
* test(anthropic): cover diagnostics on /v1/messages per provider

* fix(anthropic): forward diagnostics on /v1/messages

The native /v1/messages path rebuilt the request from a fixed field list that
did not include diagnostics, so Anthropic never saw it and returned null in place
of the cache miss reason. Forward it to every provider, and for Vertex and
Bedrock, which reject the field, fail with a 400 that names drop_params unless
the caller drops it.

* test(messages): cover diagnostics on the Rust /v1/messages path

* fix(messages): carry diagnostics through the Rust /v1/messages path

Anthropic, Azure, Vertex and Bedrock /v1/messages calls run on the Rust core,
which builds the body from the typed fields of the Messages request. Give
diagnostics a typed field so it reaches the provider, and refuse or drop it in
the bridge host for Vertex and Bedrock the same way the Python handler does.

* test(anthropic): cover diagnostics forwarding with drop_params off

* refactor(anthropic): split the diagnostics gate condition under the boolean-term limit

* test(anthropic): prove the diagnostics drop on Vertex, since Bedrock Invoke now runs only on Rust

* fix(proxy): refuse a diagnostics comparison against another key's message with 403

* test(proxy): assert diagnostics refusals outside the except block
2026-11-20 21:57:17 -08:00
..
__init__.py refactor(rust-bridge): move the route host modules under host/routes (#46786) 2026-10-15 18:27:06 -07:00
test_chat_completions.py refactor(rust-bridge): let each route host pick the body params (#46787) 2026-10-15 18:27:06 -07:00
test_messages.py fix(anthropic): forward diagnostics on /v1/messages (#52969) 2026-11-20 21:57:17 -08:00
test_ocr.py refactor(rust-bridge): move the route host modules under host/routes (#46786) 2026-10-15 18:27:06 -07:00
test_responses.py refactor(rust-bridge): move the route host modules under host/routes (#46786) 2026-10-15 18:27:06 -07:00