litellm/tests
mateo-berri 81fec9c0b1 fix(openai): give a reasoning-only assistant message empty content
A Responses API request replayed through the chat completions bridge turns a
reasoning item with no following answer into an assistant message that carries
only reasoning. The None-field cleanup then drops its content key, and strict
OpenAI-compatible servers such as llama.cpp answer 400 with "Assistant message
must contain either 'content' or 'tool_calls'!". The same happens when a chat
completions client replays a reasoning-only assistant turn.

The OpenAI chat request builder now sends content "" on an assistant message
that has reasoning but no content, tool calls or function call. The bridge
keeps content None, so the reasoning merge pass and the Anthropic, Gemini and
Bedrock converters see the same messages as before.

Fixes #54504
2026-11-25 20:51:21 -08:00
..
_support fix(gemini): return an error instead of an empty 200 when a Gemini image request gets no image (#29125) 2026-11-25 20:55:23 +00:00
audio_tests
base_sdk_tests fix(packaging): ship the license public key in the litellm-proxy sdist (#52970) 2026-11-19 23:18:32 +00:00
basic_proxy_startup_tests
benchmarks fix(guardrails): classify only the frames each read completes in Presidio's first-frame wait (#54379) 2026-11-25 11:15:49 +00:00
code_coverage_tests fix(anthropic): map /v1/messages fields onto OpenAI Responses equivalents or reject them (#54173) 2026-11-25 19:30:01 +00:00
documentation_tests
e2e refactor(ui): migrate logging callback forms to the form kit (#54562) 2026-11-26 01:28:19 +00:00
e2e_harness test(e2e): move the Claude Code matrix to Opus, Sonnet and Haiku 5.5, Fable 5.2 and GPT-6 (#54305) 2026-11-25 01:47:03 +00:00
fixtures
harness_e2e
integration fix(mcp): handle the caller Authorization on chat and responses the way native /mcp does (#54587) 2026-11-25 18:37:32 -08:00
rust-python-harness fix(gateway): serve messages drop, summary and timeout settings like Python (#51236) 2026-11-25 09:26:12 +00:00
test_litellm_rust feat(anthropic-messages): per-deployment deferred_tools handling on the /v1/messages bridge (#54183) 2026-11-25 17:14:28 +00:00
typing
unit fix(openai): give a reasoning-only assistant message empty content 2026-11-25 20:51:21 -08:00
windows_tests 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
__init__.py
_fake_openai_endpoint_server.py
_flush_vcr_cache.py
_live_test_helpers.py
_master_key.py
_module_state.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
_openai_record_replay_proxy.py
_process_helpers.py
_vcr_conftest_common.py
_vcr_redis_persister.py
_wait_helpers.py
_ws_vcr.py
AGENTS.md
capturing_transport.py
eval_swe_bench.py
fake_openai_endpoint.py
gettysburg.wav
large_text.py
openai_batch_completions.jsonl
pyrightconfig.json
README.MD
test_logging.conf
test_rust_python_harness.py
VCR_TESTING.md
white_100x100.png

In total litellm runs 1000+ tests

[02/20/2025] Update:

To make it easier to contribute and map what behavior is tested,

we've started mapping the litellm directory in tests/unit

This folder can only run mock tests.