From fb7724f8ff87d8ef34afe2fee041444d36b64ac6 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Wed, 29 Apr 2026 18:28:41 -0700 Subject: [PATCH] fix(proxy): wire /config/update into the new config DualCache invalidation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After merging litellm_internal_staging (which introduced litellm_config_cache and `await invalidate_config_param(...)` calls paired with every config write), the rewritten /config/update was left in a broken state: the auto-merge stranded one `await invalidate_config_param(k)` call inside the new litellm_settings block where `k` is undefined, raising UnboundLocalError on every request that included litellm_settings. Bake invalidation into the local `_upsert_section` helper so each section write atomically invalidates its own cache key — there's no longer a per-section call site to remember to update. Drop the stray `invalidate_config_param(k)` line. This restores tests/proxy_unit_tests/test_proxy_server.py:: test_update_config_success_callback_normalization, which was the only failing test on the proxy-server GHA shard. --- litellm/proxy/proxy_server.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index 2088ddf45f..f2f32c4e90 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -12698,6 +12698,9 @@ async def update_config( # noqa: PLR0915 "update": {"param_value": serialized}, }, ) + # invalidate the DualCache entry so the next reader (this process + # or any other proxy in the cluster) goes to DB. + await invalidate_config_param(param_name) # general_settings: merge per-key, with the alert_to_webhook_url side # effect of auto-enabling slack alerting. @@ -12740,7 +12743,6 @@ async def update_config( # noqa: PLR0915 updated_litellm_settings["success_callback"] = normalize_callback_names( incoming_cb ) - await invalidate_config_param(k) merged = {**existing, **updated_litellm_settings}