Address Greptile review feedback:
- Remove unused variable
- Replace kwargs-mutation mock (which only mutated a local copy due to
Python's **kwargs semantics) with a proper approach: patch
with a wraps= wrapper and assert it is called once
per fallback iteration. If safe_deep_copy is ever removed from
run_async_fallback, the assertion will fail — making this a true
regression guard.
When a provider handler (e.g. Bedrock's converse_handler) mutates kwargs
via .pop() calls during request processing and the request fails, the
fallback loop reuses the same kwargs dict. This leaves subsequent fallback
providers with missing keys — for example, tool_choice present but tools
removed — causing Azure OpenAI to reject the request with HTTP 400.
Fix: use safe_deep_copy(kwargs) before each fallback attempt so every
provider receives the original, unmodified parameters.
Fixes#24764
The sync and async failure handlers guarded plain-function callbacks with
`customLogger is not None`, but customLogger was only initialized in the
success handler path. If a request failed without any prior success in the
process, the failure callback was silently skipped.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Switch the passthrough e2e helper to direct HTTP transcript create/poll/delete calls so the request includes required speech_models and remains compatible with current AssemblyAI API behavior.
Made-with: Cursor
- test_caching_router: Use REDIS_HOST/PORT/PASSWORD/SSL instead of
non-existent REDIS_HOST_2 variants
- test_router_init_azure_service_principal: Use monkeypatch.setenv instead
of patching the os module in only one file, so both common_utils._resolve_env_var
and get_azure_ad_token_provider see the mocked credentials. Also clear
AZURE_OPENAI_API_KEY to prevent it from short-circuiting the token provider path.
Main rewrote the same tests we moved. Resolution: keep the tests only
in the unit test directory, adopting main's improved patterns (AsyncMock,
assert_called_once, stronger content assertions on streaming).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move test_chat_completion_snowflake and test_chat_completion_snowflake_stream
from tests/llm_translation/ to tests/test_litellm/llms/snowflake/chat/ so
they run as part of `make test-unit` without requiring API credentials.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>