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
This commit is contained in:
factnn 2026-06-25 23:47:07 +08:00
parent 906897bebf
commit 4e0aa8ad0e

View file

@ -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}