litellm/tests/unit/rust_bridge
zoveki ebf4991f75
fix(gateway): serve messages drop, summary and timeout settings like Python (#51236)
* fix(gateway): fill messages settings from LITELLM_DROP_PARAMS, the request, and litellm_settings

* fix(gateway): honor a deployment's timeout over request_timeout on messages, read numeric settings flags, and delete drop paths in place

* feat(gateway): honor request drop_params, additional_drop_params, reasoning_auto_summary and request_timeout on /v1/messages

The standalone gateway answered 501 for a request's drop_params and
additional_drop_params, a deployment's additional_drop_params, and
litellm_settings.reasoning_auto_summary and request_timeout. It now reads
each the way the Python proxy does and keeps sending to Python only the
corners where the two would differ. The unsupported-param 400 hint now
also names the proxy config key.

* perf(core-utils): delete additional_drop_params paths in place

delete_nested_value rebuilt every object along a path, so each path cost
the width of the widest map it crossed. A request can now set its own
additional_drop_params on the native /v1/messages route, and 10,000 absent
paths over a 10,000-property tool schema took about 50 seconds. Paths are
now removed in place, an absent key costs one lookup, and key order is kept.

* fix(gateway): read request_timeout where Python does, answer timeouts 408, and drop paths in one pass

The Python lane's sampling and speed 400 hints also name the proxy config key

* fix(gateway): drop overlapping paths in one visit and share the drop hint across Anthropic and Bedrock errors

* fix(gateway): read REQUEST_TIMEOUT only from the process environment

Python reads REQUEST_TIMEOUT once when litellm is imported, before the proxy
exports the config's environment_variables, so a timeout the config exports
never applies there. The gateway now reads it from its own process
environment alone, so such a config no longer times out calls Python serves

* fix(core-utils): walk drop paths without building a tree, so a deep path cannot overflow the stack

* fix(core-utils): read each drop path segment once, so a long path under [*] cannot stall a request

The walk read the rest of every path again at each list element, so one path with a long field name under [*] hashed that name once per element. Paths now grow a tree only as deep as the body goes, with each field name numbered once and each object matched from its smaller side.

* fix(core-utils): cap the drop path routes that reach one value, so overlapping paths cannot stall a request

Paths mixing [*] and index steps reach one value through one node per distinct run, and that count
doubles with every level, so 65,536 overlapping paths over 100,000 list elements held a worker past
120s. At most 64 nodes may now reach one value, and past that the call answers 400 naming
additional_drop_params. A list also reads whichever is smaller now, its named indexes or its elements

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-11-25 09:26:12 +00:00
..
host fix(gateway): serve messages drop, summary and timeout settings like Python (#51236) 2026-11-25 09:26:12 +00:00
messages feat(messages): serve bedrock invoke messages on rust only (#51330) 2026-11-15 16:58:31 -08:00
ocr refactor(rust-bridge): require the native extension (#48852) 2026-10-28 13:16:56 -07:00
trace refactor(lens): connect LiteLLM to the independent Lens service (#45529) 2026-10-09 16:17:05 -07:00
__init__.py test: migrate phase 15 legacy tests to tests/unit 2026-09-20 11:55:43 +00:00
AGENTS.md refactor(rust-bridge): decide native routing in the catalog, drop the bypass predicates (#46750) 2026-10-20 15:06:24 -07:00
native_route_wheel_test.py fix(bedrock): omit system prompt from audio transcription and report its token usage (#41565) 2026-10-28 19:23:15 -07:00
stubtest.ini test: move tests/test_litellm core utils, routing, responses, caching and rust_bridge into tests/unit (#43199) 2026-09-25 17:10:13 -07:00
test_bindings.py refactor(rust-bridge): require the native extension (#48852) 2026-10-28 13:16:56 -07:00
test_catalog.py feat(messages): serve bedrock claude_platform messages on rust only (#52681) 2026-11-19 14:34:02 -08:00
test_clickhouse.py refactor(lens): connect LiteLLM to the independent Lens service (#45529) 2026-10-09 16:17:05 -07:00
test_configuration.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_detectors.py feat(messages): serve anthropic messages on rust only (#51119) 2026-11-12 00:07:20 +00:00
test_execution.py refactor(rust-bridge): return an unstarted Execution from native entrypoints and drive it in Python (#46299) 2026-10-14 17:50:44 -07:00
test_failures.py test: move tests/test_litellm core utils, routing, responses, caching and rust_bridge into tests/unit (#43199) 2026-09-25 17:10:13 -07:00
test_fork_guard.py refactor(rust-bridge): require the native extension (#48852) 2026-10-28 13:16:56 -07:00
test_logger.py refactor(rust_bridge): send every Rust log line through one subscriber (#53738) 2026-11-23 17:53:54 +09:00
test_public_call.py fix(rust): run native async calls through python's async wrapper steps (#50423) 2026-11-10 00:24:20 +00:00
test_runtime.py feat(messages): serve anthropic messages on rust only (#51119) 2026-11-12 00:07:20 +00:00
test_token_counter.py fix(proxy): count the request's tool_choice on the token count routes (#51133) 2026-11-14 07:53:27 -05:00
test_tokenizer.py refactor(sdk): separate core AWS and tokenizer dependencies (#44447) 2026-10-08 19:07:57 -07:00
test_verify_linux_native_wheel.py chore: move scripts and runtime sources under litellm (#51006) 2026-11-12 04:19:57 +00:00