From 1d71e306cc13008f551d8964623ca813ca44bccb Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Thu, 3 Sep 2026 15:38:15 -0700 Subject: [PATCH] test(router): assert a non-chat configured mode round-trips With every kept get_configured_mode test using mode "chat", a Router that answered "chat" for any non-blank configured mode passed all four of them (the deleted #39630 pair's audio_speech case was the only test catching it). Read the mode back as audio_speech on an unmapped model so the configured value itself is what the test checks. Six hand-applied mutations of Router.get_configured_mode, including that hardcoded-chat one, are now all killed by the four surviving tests. --- tests/test_litellm/test_router.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_litellm/test_router.py b/tests/test_litellm/test_router.py index 417c58b95f6..228588d974f 100644 --- a/tests/test_litellm/test_router.py +++ b/tests/test_litellm/test_router.py @@ -7362,14 +7362,14 @@ def test_get_configured_mode_reads_deployment_model_info(): router = litellm.Router( model_list=[ { - "model_name": "chat-model", - "litellm_params": {"model": "openai/some-unmapped-model"}, - "model_info": {"mode": "chat"}, + "model_name": "tts-model", + "litellm_params": {"model": "openai/some-unmapped-tts-model"}, + "model_info": {"mode": "audio_speech"}, } ] ) - assert router.get_configured_mode("chat-model") == "chat" + assert router.get_configured_mode("tts-model") == "audio_speech" def test_get_configured_mode_returns_none_for_unset_or_unknown():