fix(proxy): wire /config/update into the new config DualCache invalidation

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.
This commit is contained in:
Yuneng Jiang
2026-04-29 18:28:41 -07:00
parent 9b019aaa6b
commit fb7724f8ff
+3 -1
View File
@@ -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}