litellm/tests/unit/llms/anthropic/chat
linhqm 151907a3f8
fix(guardrails): keep cache_control in /v1/messages guardrail translation for Claude and Gemini aliases (#53742)
* fix(guardrails): keep the client's cache_control in /v1/messages guardrail translation for every model name

* test(guardrails): fail the Headroom alias test with a clear message when the cached prefix is sent

* fix(guardrails): keep cache_control in guardrail translation only for deployments that honor it

A model alias keeps the client's cache_control when the requested name or any router deployment behind it can cache, so Headroom and TypeSafe still compress history for aliases that point at models that ignore the markers

* fix(guardrails): find team models when deciding to keep cache_control

The guardrail sees a team model's public name before routing maps it, so the deployment lookup now passes the caller's team id. It also reads the router registry instead of the deprecated get_model_list.

* test(guardrails): pin that a group with one Claude deployment keeps cache_control

* test(guardrails): pin that Gemini and Bedrock ARN aliases keep cache_control

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-11-23 09:35:07 -08:00
..
guardrail_translation fix(guardrails): keep cache_control in /v1/messages guardrail translation for Claude and Gemini aliases (#53742) 2026-11-23 09:35:07 -08:00
__init__.py test: move tests/test_litellm/llms into tests/unit/llms (#43191) 2026-09-25 12:43:23 -07:00
conftest.py test: move tests/test_litellm/llms into tests/unit/llms (#43191) 2026-09-25 12:43:23 -07:00
test_anthropic_chat_handler.py fix(exceptions): keep the provider error body on e.response for SDK callers (#53587) 2026-11-23 07:23:53 +00:00
test_anthropic_chat_transformation.py fix(anthropic)!: send extra_body fields at the top level of the Messages request (#48373) 2026-11-20 06:52:56 -08:00
test_code_interpreter_results_extraction.py feat(anthropic): workload identity federation and pluggable identity sources (#44448) 2026-10-03 17:08:30 -07:00
test_transformation.py test: move whole-unit legacy test files into tests/unit and delete dead skips (#44807) 2026-10-07 05:02:28 +00:00