litellm/tests/unit/test_router
zoveki fb00770538
fix(decisions): accept OpenAI input_json content parts on /v1/decisions (#52805)
* fix(decisions): accept OpenAI input_json content parts on /v1/decisions

User messages on the OpenAI-format /v1/decisions route can now carry
input_json parts whose data is an object or an array of objects. OpenAI
and Azure deployments forward them unchanged. Providers without JSON input
answer 400 naming input_json, or drop the part under drop_params. An
input_json part takes no prompt_cache_breakpoint, matching OpenAI.

* fix(router): send Decisions input_json to deployments that take JSON in a mixed group

* test(decisions): match input_json test answers to the asked question

* fix(decisions): catch tuple input_json in the router filter and mark it in latest-turn spend logs

* fix(router): keep JSON-only Decisions calls off deployments that would drop all input under drop_params

* fix(router): skip Decisions deployments whose drop would leave no input under drop_params

* fix(decisions): run text guardrails on input_json data and count only kept image types

* fix(decisions): redact input_json keys, scan it in LLM Shield and Cisco, count only surely kept images

hide_secrets now checks each input_json value with its key in front and rewrites secrets found in keys too. LLM Shield scans the strings in input_json data, and Cisco AI Defense scans the data as JSON text and falls back to on_flagged_action in redact mode, since it cannot write redacted text back into JSON

The drop_params check that skips a deployment the drop would leave with no input now counts an image as kept only when it is well formed and its media type is known to be one the deployment takes

* fix(guardrails): keep colliding input_json keys apart and let LLM Shield mask keys and numbers

hide-secrets now gives a key that redacts to an existing name a numbered
suffix, so two secret keys in one object no longer collapse into one
value. LLM Shield now sends input_json keys and numbers to the shield
too, writes a number back only when the shield changed it, and renames
keys after every value write so no value lands under an old key

* fix(guardrails): block Cisco redact verdicts on input_json in every mode and resume colliding key suffixes

* fix(guardrails): refuse Cisco redaction of input_json even when the request carries a messages field

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-11-20 13:33:36 -08:00
..
core fix(decisions): accept OpenAI input_json content parts on /v1/decisions (#52805) 2026-11-20 13:33:36 -08:00
__init__.py
test_enforce_model_rate_limits.py refactor(router): count the whole router_usage family on the native store (#50862) 2026-11-13 03:22:28 +00:00
test_io_token_rate_limits.py refactor(router): count the whole router_usage family on the native store (#50862) 2026-11-13 03:22:28 +00:00
test_router.py feat(auth): read projects, tags, access groups and object permissions through rust repositories (#52178) 2026-11-18 22:32:06 +00:00
test_router_callback_hook_sequence.py test: replace 61 live logging and otel tests with offline unit and integration coverage (#45362) 2026-10-08 15:55:57 -07:00
test_router_endpoints.py refactor(router): delete the python router core, the rust core is the only core (#50178) 2026-11-05 10:40:46 -08:00
test_router_entry_points.py feat(proxy): mixed Codex model picker and LiteLLM routing on native codex routes (#49408) 2026-11-06 11:14:47 -08:00
test_router_facade.py refactor(router): delete the python router core, the rust core is the only core (#50178) 2026-11-05 10:40:46 -08:00
test_router_fallbacks.py refactor(router): delete the python router core, the rust core is the only core (#50178) 2026-11-05 10:40:46 -08:00
test_router_fuzz_regressions_rust_only.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
test_router_get_deployments.py refactor(router): delete the python router core, the rust core is the only core (#50178) 2026-11-05 10:40:46 -08:00
test_router_helper_utils.py fix(bedrock): send native chat and Responses calls to aws_bedrock_runtime_endpoint like Converse (#50582) 2026-11-19 16:40:23 -08:00
test_router_host.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
test_router_max_parallel_requests.py feat(tts)!: stream audio from the provider as it arrives on /v1/audio/speech (#46222) 2026-11-17 15:03:12 +00:00
test_router_provider_endpoints.py feat(redis): serve the proxy's common Redis call with Rust stores (#50170) 2026-11-06 06:01:11 +00:00
test_router_retries.py refactor(router): delete the python router core, the rust core is the only core (#50178) 2026-11-05 10:40:46 -08:00
test_router_surface_check.py chore: move workspace packages under litellm (#51000) 2026-11-12 04:19:57 +00:00
test_router_timeout.py feat(messages): serve bedrock invoke messages on rust only (#51330) 2026-11-15 16:58:31 -08:00
test_router_vector_store_endpoints.py test: migrate SDK and proxy-booting legacy CircleCI tests to their tiers (#45758) 2026-10-11 00:17:21 -07:00