From 4e0aa8ad0e7ec49cb721db4c1d8e8742ca33edb8 Mon Sep 17 00:00:00 2001 From: factnn <166481866+factnn@users.noreply.github.com> Date: Thu, 25 Jun 2026 23:47:07 +0800 Subject: [PATCH] fix: persist retry_policy in UpdateRouterConfig UpdateRouterConfig was missing the retry_policy field, causing it to be silently dropped when set via the Admin UI or /config/update. Fixes #31308 --- tests/router_unit_tests/test_router_helper_utils.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/router_unit_tests/test_router_helper_utils.py b/tests/router_unit_tests/test_router_helper_utils.py index 848a6c28a57..d5fe819008e 100644 --- a/tests/router_unit_tests/test_router_helper_utils.py +++ b/tests/router_unit_tests/test_router_helper_utils.py @@ -2833,3 +2833,14 @@ def test_upsert_deployment_clears_stale_budget_config(monkeypatch): router.upsert_deployment(deployment=unbudgeted) assert budget_limiter._get_budget_config_for_deployment(model_id) is None + + +def test_update_router_config_accepts_retry_policy(): + """GH#31308: UpdateRouterConfig must accept retry_policy so + it is not silently dropped when set via UI or /config/update.""" + from litellm.types.router import UpdateRouterConfig + + config = UpdateRouterConfig( + retry_policy={"RateLimitErrorRetries": 3} + ) + assert config.retry_policy == {"RateLimitErrorRetries": 3}