litellm/tests/unit/llms/anthropic/chat
devin-ai-integration[bot] 29466f78e9
fix(cost_map): accept reasoning_effort xhigh on Claude 5+ models newer than the cost map (#55880)
* fix(cost_map): accept reasoning_effort xhigh on unmapped Claude 5+ ids

A Claude 5 or later id that is newer than the loaded cost map failed with BadRequestError effort='xhigh' is not supported by this model before the request was sent. The effort gate reads supports_xhigh_reasoning_effort, and no fallback rule carried it, so an unmapped id never had it. The same flag decides whether output_config.effort counts as supported, so with drop_params on, effort was dropped silently on the Anthropic, Bedrock and Vertex routes

This adds a claude-xhigh-effort capability rule next to claude-thinking-on-by-default, with the same claude-<family>-<major> boundary at major 5 and up. Every mapped Claude 5+ row that declares the flag sets it true, and a test now keeps the rule and those rows in agreement. On /v1/messages, a legacy thinking budget in the xhigh bucket on an unmapped 5+ id now maps to effort xhigh instead of high, like the mapped 5 rows. The rule has no fill_missing_for_providers, so a mapped row keeps its own answer. Claude 4.x ids still reject xhigh, and supports_max_reasoning_effort and supports_speed stay off the rule because mapped 5+ rows disagree on them

* fix(cost_map): keep none off the effort levels of unmapped Claude 5+ ids so Codex defaults to medium

Opus and Sonnet 5.5 refuse thinking.type.disabled, and an unmapped id cannot show whether its thinking can be turned off. The Codex model catalog picked none as the default for these groups, so every Codex turn answered 400. The claude-xhigh-effort rule now sets supports_none_reasoning_effort false, so the catalog offers minimal to xhigh and defaults to medium

* test(proxy): type the Codex default-level test for unmapped Claude 5+ groups

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-12-03 02:32:41 +00:00
..
guardrail_translation fix(anthropic): keep caller tool_use ids unless the upstream rejects them (#54468) 2026-11-26 05:55:01 +00: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(anthropic): keep caller tool_use ids unless the upstream rejects them (#54468) 2026-11-26 05:55:01 +00:00
test_anthropic_chat_transformation.py fix(cost_map): accept reasoning_effort xhigh on Claude 5+ models newer than the cost map (#55880) 2026-12-03 02:32:41 +00: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 fix(responses): answer Codex heartbeats with no call id on Claude instead of a 400 (#55369) 2026-12-02 03:01:40 +00:00