litellm/litellm/responses
tin-berri c82c9cbced
fix(router): strip encrypted reasoning on an auto-router tier change instead of a 503 (#40280)
A Responses API follow-up that replays reasoning.encrypted_content is pinned to the
deployment that minted it. Behind an auto-router the pre-routing hook rebinds the model
to the tier it picked before the candidate pool is built, so a turn that classifies into a
different tier never finds the origin and the affinity check raised its fail-fast 503,
whose text claims a cooldown that does not exist

When the deployment that minted the reasoning is not a member of the model group this turn
is routed to, strip the encrypted reasoning (keeping any readable summary, string or block
form) and dispatch to the routed group. Membership is tested by deployment id against the
candidate set the router itself resolved for the route (routing group, model_name, team,
and pattern alike), not by model-group name, so an alias, a provider-qualified spelling, a
team-public name, or a pattern route of the same group is not misread as a tier change.
An unknown origin (a removed deployment, or a forged/unauthenticated marker) is handled the
same as a cross-group one and its reasoning is stripped, so a real cross-group id and a
nonexistent id return the same response and cannot be used to enumerate deployment ids.
Unavailability within the origin's own group keeps the existing 429/503 fail-fast, so the
cooldown contract is unchanged

Resolves LIT-7195


Claude-Session: https://claude.ai/code/session_01KAumQbhzk6jdWWHFLA8Jar

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-09 11:04:11 -07:00
..
file_search fix(file_search): escape the dropped vector_store_id in the warning 2026-09-05 16:44:54 -07:00
litellm_completion_transformation merge: litellm_internal_staging into litellm_headroom_ccr_streaming_responses 2026-09-03 00:24:17 +00:00
mcp merge: bring litellm_internal_staging into litellm_fix_agent_mcp_grants 2026-09-07 16:35:40 -07:00
main.py Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_lit_4116_drop_params_string_coerce 2026-09-08 15:08:38 -07:00
sse_output_recovery.py refactor(repositories): type prisma table access with one generic protocol 2026-08-25 12:14:17 +00:00
streaming_iterator.py refactor: clear fresh tech debt from the last 24 hours (2026-09-03) 2026-09-03 08:09:51 +00:00
utils.py fix(router): strip encrypted reasoning on an auto-router tier change instead of a 503 (#40280) 2026-09-09 11:04:11 -07:00