From 2a1e52b84488970b0cfc4886c2f5aa38b36ea92f Mon Sep 17 00:00:00 2001 From: yassin Date: Thu, 27 Aug 2026 01:24:01 +0000 Subject: [PATCH] fix: guard cache_hit_filter validation for direct handler calls Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- litellm/proxy/spend_tracking/spend_management_endpoints.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/proxy/spend_tracking/spend_management_endpoints.py b/litellm/proxy/spend_tracking/spend_management_endpoints.py index 9ca8991df2d..167d950fe0c 100644 --- a/litellm/proxy/spend_tracking/spend_management_endpoints.py +++ b/litellm/proxy/spend_tracking/spend_management_endpoints.py @@ -2315,7 +2315,7 @@ async def ui_view_spend_logs( param="sort_order", code=status.HTTP_400_BAD_REQUEST, ) - if cache_hit_filter is not None and cache_hit_filter not in {"hit", "miss"}: + if isinstance(cache_hit_filter, str) and cache_hit_filter not in {"hit", "miss"}: raise ProxyException( message=f"Invalid cache_hit_filter: {cache_hit_filter}. Must be one of: hit, miss", type="bad_request",