chore: simplify fallback kwargs copy comment

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Milan 2026-05-08 15:15:55 +03:00
parent 219a42f745
commit b75b090a34
No known key found for this signature in database

View file

@ -124,12 +124,8 @@ async def run_async_fallback(
if mg == original_model_group:
continue
try:
# Deep copy kwargs so each fallback attempt starts from the
# original, unmodified parameters. Without this, provider-
# specific handlers (e.g. Bedrock's converse_handler) can
# mutate kwargs via .pop() calls, leaving subsequent fallback
# providers with missing keys (e.g. `tool_choice` present but
# `tools` removed). See https://github.com/BerriAI/litellm/issues/24764
# Keep each fallback attempt isolated from mutations made while
# preparing or sending a previous attempt.
fallback_kwargs = safe_deep_copy(kwargs)
# LOGGING