litellm/tests/test_litellm/llms/anthropic
devin-ai-integration[bot] 58a05a9eae
fix(anthropic): return 400 instead of 500 when a content list holds a bare string (#42420)
* fix(anthropic): skip non-dict content items in beta-header and file-id helpers so malformed content lists return 400 instead of 500

Fixes #42094
Supersedes #42101

Co-authored-by: Pawan-Shahane <shahanepawan511@gmail.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(e2e): spawn the DB-less regression proxy with -P so the cwd cannot shadow the pinned checkout

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(e2e): launch the DB-less proxy via -I -c with an explicit sys.path so python 3.10 works, drop DIRECT_URL, remove restating docstrings

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(e2e): gate the self-booted DB-less proxy behind the owned_gateway opt-in the Buildkite container cannot satisfy

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(anthropic): move the bare string content item repro to tests/integration

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* style(tests): wrap the anthropic bare string wire test to the 120 column limit

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* style(tests): wrap anthropic common_utils test literals to the 120 column limit

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* style: fix ruff findings in touched test files

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: kerry <kerry@berri.ai>
Co-authored-by: Pawan-Shahane <shahanepawan511@gmail.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-22 15:44:30 -07:00
..
batches test: migrate wave 1 phase 2 legacy unit tests to tests/unit 2026-09-20 07:50:43 +00:00
chat feat(router): native compact-to-fit across conversation APIs (#42074) 2026-09-21 22:52:29 -07:00
experimental_pass_through feat(router): native compact-to-fit across conversation APIs (#42074) 2026-09-21 22:52:29 -07:00
files test(unit): migrate wave 1 phase 3 anthropic, apiserpent, azure and azure_ai legacy tests 2026-09-20 08:19:05 +00:00
__init__.py test(batches): add 1:1 test file scaffold for batches component paths (#30529) 2026-06-29 09:22:58 +05:30
test_anthropic_common_utils.py fix(anthropic): return 400 instead of 500 when a content list holds a bare string (#42420) 2026-09-22 15:44:30 -07:00
test_anthropic_count_tokens_transformation.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_anthropic_files_and_batches.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_anthropic_output_format_filter.py fix(anthropic): strip all remaining output_format schema keywords rejected by Anthropic 2026-07-22 16:16:04 -07:00
test_anthropic_prompt_cache_prediction.py fix(proxy): estimate auto-router baseline costs from durable cache history 2026-09-19 12:44:47 -07:00
test_anthropic_reasoning_effort.py fix(anthropic/bedrock): request summarized adaptive thinking for reasoning_effort and use provider thinking token counts 2026-08-22 23:10:42 +00:00
test_anthropic_schema_filter.py fix(anthropic): reconcile enum with declared type in output_format schema (#37882) 2026-08-24 11:43:47 -07:00
test_anthropic_structured_output.py fix(model_map): flag native structured outputs on Anthropic-direct claude-sonnet-5 and claude-haiku-4-5 (#35930) 2026-08-15 11:51:35 -07:00
test_azure_ai_cache_pricing.py test: delete assertions that pin vendor cost map facts 2026-09-18 00:28:49 +00:00
test_cost_calculation_dict_safety.py refactor: dedupe server_tool_use web search reads and type fresh test locals 2026-08-27 08:01:52 +00:00
test_count_tokens_oauth.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_message_sanitization.py fix(anthropic, mcp): sanitize tool names to match Anthropic's [a-zA-Z0-9_-]{1,128} pattern (#26788) 2026-05-06 00:00:36 +00:00