litellm/tests/test_litellm/router_utils
devin-ai-integration[bot] 8441dd6e8c
fix(proxy): keep SpendLogs and callback session ids in sync when the request has none (#39450)
* fix(proxy): keep SpendLogs and callback session ids in sync when the request has none

Add general_settings.missing_session_id (generate | reject). In generate mode one id is
stamped into litellm_session_id, litellm_trace_id and metadata.session_id before callbacks
run, so LiteLLM_SpendLogs.session_id and the Langfuse session id match. In reject mode such
requests get a 400. Unset keeps the legacy behavior. MCP routes are not affected

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

* chore(proxy): regenerate schema.d.ts and shorten mutable-ok comment for ruff format

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

* fix(proxy): mark generated session ids so affinity consumers do not pin on them

Fireworks x-session-affinity, the router session_affinity pre-call check and the
complexity router session pin all read metadata.session_id as a caller-chosen
stable key. A missing_session_id: generate id is fresh per request, so it now
carries metadata.litellm_session_id_generated and those consumers skip it

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

---------

Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-02 18:28:06 -07:00
..
pre_call_checks fix(proxy): keep SpendLogs and callback session ids in sync when the request has none (#39450) 2026-09-02 18:28:06 -07:00
test_add_retry_fallback_headers.py feat(router): add separate ITPM/OTPM deployment rate limits (#31952) 2026-07-05 21:58:35 +05:30
test_auto_router_model_naming.py fix(router): reject complexity-router settings written outside complexity_router_config (#38570) 2026-08-27 17:04:49 -07:00
test_cooldown_cache.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_cooldown_handlers.py feat(router): make routing groups callable as virtual models and list them in /v1/models (#36519) 2026-08-11 18:41:19 -07:00
test_fallback_event_handlers.py fix(router): preserve bound router fallbacks for subagents 2026-09-02 16:01:15 -07:00
test_health_check_allowed_fails_integration.py feat(health): opt-in model-group allowlist for background health checks and health-check routing (#38539) 2026-08-27 12:25:56 -07:00
test_health_state_cache.py feat(health): opt-in model-group allowlist for background health checks and health-check routing (#38539) 2026-08-27 12:25:56 -07:00
test_pattern_match_deployments.py fix(router): guard the declared-provider check for requests without a model 2026-09-01 14:06:14 -07:00
test_reasoning_effort_capability.py fix(anthropic): handle per-level reasoning_effort flags without supports_reasoning (#38618) 2026-08-27 22:19:22 -07:00
test_router_health_check_routing.py feat(health): opt-in model-group allowlist for background health checks and health-check routing (#38539) 2026-08-27 12:25:56 -07:00
test_router_interactions_endpoints.py Gemini managed agents support (#28270) 2026-05-19 16:02:03 -07:00
test_router_utils_common_utils.py fix(router): warn when a deployment's credentials contradict its provider (#36486) 2026-08-10 18:41:19 -07:00