litellm/tests/code_coverage_tests
linhqm 21450cdefc
fix(anthropic): map /v1/messages fields onto OpenAI Responses equivalents or reject them (#54173)
* fix(anthropic): map /v1/messages fields onto OpenAI Responses equivalents or reject them

The Responses bridge for /v1/messages dropped several Anthropic fields and still answered 200. disable_parallel_tool_use now sets parallel_tool_calls false, speed fast asks for the priority service tier, mcp_servers become Responses mcp tools with their toolset allowlist, web_search keeps its domain filters, user_location, and max_uses, a json_schema output format goes up strict, and a 1h cache_control mark asks OpenAI for its 12h breakpoint TTL

A field with no Responses equivalent (container, allowed_callers, an unknown speed, a toolset denylist, defer_loading, max_uses next to another built-in tool) answers 400 UnsupportedParamsError naming every such field, and drop_params drops them instead

strict_json_schema moves to base_utils so the Codex harness, the chat-completions bridge, and the Responses bridge share one walker, which now leaves property names and enum, const, and examples values alone

* fix(openai): keep the 1h cache ttl to the Responses API, since Chat Completions rejects a breakpoint ttl

* test(openai): expect the 12h breakpoint ttl a 1h cache mark now sends on the Responses wire

* refactor(anthropic): read the new /v1/messages fields through typed views

* fix(anthropic): keep schema refs and maps in strict output, and answer 400 for a container id

The bridge goes back to the strict-schema helper from #51337, so a root $ref keeps its $defs and a map keeps its
value schema on every provider. A container id string and a malformed mcp_servers entry now answer 400, or are
dropped under drop_params, instead of a 500

* fix(anthropic): leave out speed and container when additional_drop_params lists them

* fix(anthropic): reject or map the remaining /v1/messages fields on the OpenAI bridge and redact the MCP authorization

top_k and inference_geo have no Responses equivalent, so they now answer 400 like container unless drop_params
or additional_drop_params drops them, instead of a silent 200. An mcp_toolset that names no mcp_servers entry
answers 400 the same way. The error says to set drop_params: true in the model's litellm_params or under
litellm_settings.

A forwarded service_tier of auto no longer beats speed fast, since auto asks for nothing specific. A top-level
cache_control marks the last block of the conversation the way Anthropic caches it, and an mcp_call output comes
back as mcp_tool_use and mcp_tool_result blocks that replay on the next turn.

The server token goes out as the Responses mcp tool's authorization field, so both redactors now scrub a value
under a quoted authorization key in JSON or a Python repr. A value litellm already masked, like the Authorization
header in the JSON debug log, keeps its hint, and an Authorization header name is left alone.

* fix(anthropic): leave the top-level cache mark off when the deployment drops cache_control

* fix(proxy): count mcp_servers by name in the /v1/messages tool allowlist

* fix(logging): redact MCP server tokens from logged model parameters

The standard logging payload copied tools and mcp_servers into
model_parameters as sent, so an MCP server's authorization or
authorization_token reached every logging callback in plain text.

* fix(anthropic): keep the Messages container field read-only

Mark AnthropicMessagesRequestOptionalParams.container ReadOnly and pass it when the Responses adapter builds its request instead of setting it afterwards

* fix(anthropic): send open schemas non-strict, guard MCP blocks, and narrow the authorization log pattern

OpenAI strict structured outputs reject a map or a free-form object, so a
Messages output schema that leaves an object open now goes to the Responses
API with strict false instead of answering 400.

Guardrails on /v1/messages now read mcp_tool_use input and mcp_tool_result
text in requests and replies, and write a masked result back, the way they
already handle tool_use and tool_result. That covers replayed history too.

The quoted authorization log pattern now needs a word boundary and skips
null, None and booleans, so keys like requires_authorization log as sent.

* fix(anthropic): pair a replayed MCP result with its use by id and keep a top-level cache mark before a prefill

* fix(redaction): redact an MCP authorization value that only starts with null or a boolean

The exception for a literal null, None, true or false authorization value now needs the whole value to be that literal, so a token such as null-<rest> is redacted in Python and Rust

* fix(anthropic): send a structured output schema non-strict when OpenAI strict mode would reject it

* fix(anthropic): resend a web search without domain filters when OpenAI refuses them under drop_params

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-11-25 19:30:01 +00:00
..
azure_client_usage_test.py
ban_constant_numbers.py
ban_copy_deepcopy_kwargs.py
bedrock_pricing.py Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_ruff_dead_test_code 2026-08-24 09:46:56 -07:00
callback_manager_test.py
check_data_replace_usage.py
check_e2e_no_raw_requests.py test(e2e): share the coding-CLI harness between suites (#49370) 2026-11-02 13:50:56 -08:00
check_endpoint_coverage.py Revert "[Feature] Add /public/supported_endpoints endpoint" 2026-02-26 17:21:43 -08:00
check_fastuuid_usage.py
check_get_model_cost_key_performance.py refactor(model-cost): move the cost map inputs, fetch and register_model overlay into Rust (#50501) 2026-11-10 02:37:35 +00:00
check_guardrail_apply_decorator.py content filter test fix 2026-02-12 17:54:16 -08:00
check_licenses.py chore: move config and docs off the repo root (#50966) 2026-11-11 18:29:35 -08:00
check_migrations_lock_timeout.py chore: move workspace packages under litellm (#51000) 2026-11-12 04:19:57 +00:00
check_migrations_no_data_rewrites.py fix(proxy-extras): build the remaining request-log indexes in the migration job instead of in migrations (#49667) 2026-11-23 10:15:35 -08:00
check_no_none_string_error_fields.py fix(proxy)!: stop answering with the literal string "None" as error type and param on the proxy-server, auth, spend, and key health routes (#39540) 2026-10-29 18:20:52 -07:00
check_no_publicly_known_master_key.py fix(ui): rebuild the dashboard bundle and cover it in the example master key check (#47612) 2026-10-20 13:02:29 -07:00
check_prisma_binary_cache.py fix(ci): bound setup steps so pytest always gets its full budget 2026-08-10 16:22:07 +00:00
check_provider_folders_documented.py feat(harness): add pi harness for litellm.agent() (#45467) 2026-10-20 09:01:40 +00:00
check_py310_typing_imports.py fix: keep litellm importable on Python 3.10 and guard 3.11-only typing imports in CI (#39448) 2026-09-02 18:27:19 -07:00
check_router_constructor_stub.py fix(router): make the constructor stub work for mypy and guard it in CI (#50354) 2026-11-22 21:25:00 +00:00
check_spanattributes_value_usage.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
check_telemetry_imports.py feat(telemetry): add litellm.telemetry records, semantic group consent and sink protocol (#45484) 2026-10-13 18:19:22 -07:00
check_unbounded_in_lists.py ci: fail on new unbounded SQL IN lists and add a Prisma chunking helper (#42629) 2026-09-26 13:40:44 -07:00
check_unsafe_enterprise_import.py chore: move workspace packages under litellm (#51000) 2026-11-12 04:19:57 +00:00
check_workflow_job_name_collisions.py fix(ci): keep an expression matrix directive out of the comparison 2026-09-06 02:59:16 -07:00
check_workflow_startup_safety.py ci: render lint, unit and smoke checks as <tier> / <job> with one collector per tier (#45480) 2026-10-09 04:28:41 +00:00
code_qa_check_tests.py test: migrate legacy unit dirs and unrun folders into tests/unit, tests/integration and tests/e2e (#45940) 2026-10-11 06:24:57 -07:00
dependency_license_cache.json fix(caching): upgrade redisvl to 0.26.0 so the redis-semantic cache works with restricted Redis users (#54410) 2026-11-25 17:27:11 +00:00
enforce_llms_folder_style.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
ensure_async_clients_test.py feat(proxy): send gateway model calls to Lens as traces when the Lens store is connected (#53042) 2026-11-20 10:12:08 -08:00
info_log_check.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
liccheck.ini feat(gnani): add Prisma v2.5 and v3.0 realtime transcription (#53828) 2026-11-25 10:51:59 +00:00
license_cache.json fix(deps): update python-multipart to >=0.0.20 in CI and test configs 2026-03-03 15:10:39 -03:00
litellm_logging_code_coverage.py
log.txt
memory_test.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
prevent_key_leaks_in_exceptions.py
recursive_detector.py fix(anthropic): map /v1/messages fields onto OpenAI Responses equivalents or reject them (#54173) 2026-11-25 19:30:01 +00:00
router_code_coverage.py fix(openrouter): report the context window and output cap from OpenRouter's catalog (#54046) 2026-11-24 04:37:30 -08:00
router_enforce_line_length.py
router_litellm_globals_check.py refactor(router): delete the python router core, the rust core is the only core (#50178) 2026-11-05 10:40:46 -08:00
router_surface_allowlist.json fix(proxy): reserve least-busy picks on Vertex pass-through calls (#53588) 2026-11-23 04:21:20 +00:00
router_surface_check.py chore: move workspace packages under litellm (#51000) 2026-11-12 04:19:57 +00:00
test_aio_http_image_conversion.py
test_ban_set_verbose.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_chat_completion_imports.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_check_no_none_string_error_fields.py fix(proxy)!: stop answering with the literal string "None" as error type and param on the proxy-server, auth, spend, and key health routes (#39540) 2026-10-29 18:20:52 -07:00
test_check_no_publicly_known_master_key.py chore: move ui and vscode-extension under litellm and delete docs (#50992) 2026-11-12 04:19:57 +00:00
test_e2e_idp_stack.py test(e2e): verify IdP readiness through real HTTP 2026-09-11 17:25:38 -07:00
test_e2e_junit_report.py test(mcp): replace the live Linear MCP OAuth e2e tests with integration coverage (#47154) 2026-10-17 14:29:59 -07:00
test_e2e_metadata.py ci: render lint, unit and smoke checks as <tier> / <job> with one collector per tier (#45480) 2026-10-09 04:28:41 +00:00
test_generate_provider_endpoints_support.py chore: move scripts and runtime sources under litellm (#51006) 2026-11-12 04:19:57 +00:00
test_merge_smoke.py ci: render lint, unit and smoke checks as <tier> / <job> with one collector per tier (#45480) 2026-10-09 04:28:41 +00:00
test_no_hardcoded_secrets.py test: run the 30 test files stranded in the second mirror (#37595) 2026-08-20 10:59:43 -07:00
test_provider_cache.py fix(e2e): restore main qualification across providers and UI (#49763) 2026-11-03 20:38:47 +00:00
test_provider_replay_harness.py test(e2e): move the harness self-tests out of tests/e2e (#45172) 2026-10-07 22:20:02 +00:00
test_proxy_types_import.py refactor(logging): load enterprise alerting loggers lazily so import litellm skips proxy types (#44762) 2026-10-05 22:06:53 -07:00
test_router_strategy_async.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_run_parallel_checks.py ci(lint): run the fast lint checks on pull requests again without compiling Rust (#53421) 2026-11-21 14:17:30 -08:00
test_scan_bundled_crypto.py feat(docker): install cryptography, grpcio and libpq from chainguard apks in the fips image (#52997) 2026-11-20 15:58:28 -08:00
test_unit_passed_gate.py ci: run a core set of unit, lint and smoke jobs on pull requests and the rest on main (#52582) 2026-11-18 10:34:07 -08:00
test_workflow_job_name_collisions.py fix(ci): keep an expression matrix directive out of the comparison 2026-09-06 02:59:16 -07:00
unbounded_in_baseline.txt fix(proxy): preserve concurrent access group assignments (#53840) 2026-11-23 16:27:41 -08:00