From b902bf210e7579006019751320690ad8cbfa09f2 Mon Sep 17 00:00:00 2001 From: Arnold Galovics Date: Fri, 18 Sep 2026 09:21:20 +0200 Subject: [PATCH] fix(tags): resolve CI failures on tag spend reset PR - suppress BLE001 for the Redis best-effort catch, matching the sanctioned pattern used elsewhere for intentional broad catches - regenerate schema.d.ts so the dashboard types include the new spend field on TagUpdateRequest --- litellm/proxy/management_endpoints/tag_management_endpoints.py | 2 +- ui/litellm-dashboard/src/lib/http/schema.d.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/litellm/proxy/management_endpoints/tag_management_endpoints.py b/litellm/proxy/management_endpoints/tag_management_endpoints.py index 7c9c892b4dc..f10f13d6663 100644 --- a/litellm/proxy/management_endpoints/tag_management_endpoints.py +++ b/litellm/proxy/management_endpoints/tag_management_endpoints.py @@ -484,7 +484,7 @@ async def update_tag( if spend_counter_cache.redis_cache is not None: try: await spend_counter_cache.redis_cache.async_set_cache(key=counter_key, value=tag.spend, ttl=60) - except Exception as redis_err: + except Exception as redis_err: # noqa: BLE001 # best-effort refresh: a Redis failure must not fail the request verbose_proxy_logger.warning( "Failed to update spend counter %s in Redis after tag spend update: %s. " "Budget checks may use stale value until counter expires.", diff --git a/ui/litellm-dashboard/src/lib/http/schema.d.ts b/ui/litellm-dashboard/src/lib/http/schema.d.ts index b72f2503e5d..f6973a6d7b4 100644 --- a/ui/litellm-dashboard/src/lib/http/schema.d.ts +++ b/ui/litellm-dashboard/src/lib/http/schema.d.ts @@ -16344,6 +16344,7 @@ export interface paths { * - description: Optional[str] - Updated description * - models: List[str] - Updated list of allowed LLM models * - budget_id: Optional[str] - The id for a budget to associate with the tag + * - spend: Optional[float] - Set the tag's accumulated spend (e.g. 0 to reset it). Omit to leave unchanged. Does not change budget_reset_at; the current budget window is left as-is * * ### BUDGET UPDATE PARAMS ### * - max_budget: Optional[float] - Max budget for tag @@ -45505,6 +45506,8 @@ export interface components { rpm_limit?: number | null; /** Soft Budget */ soft_budget?: number | null; + /** Spend */ + spend?: number | null; /** Tpm Limit */ tpm_limit?: number | null; };