From f1246c40c00ac0c5388e6c93eedf034c0e9e96a6 Mon Sep 17 00:00:00 2001 From: sotazhang Date: Thu, 4 Dec 2025 17:12:59 +0800 Subject: [PATCH] [Fix] Add namespace check to async_delete_cache in Redis cache MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ensure key namespace is properly handled before deletion in async flow to maintain consistency with sync delete_cache method. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- litellm/caching/redis_cache.py | 1 + 1 file changed, 1 insertion(+) diff --git a/litellm/caching/redis_cache.py b/litellm/caching/redis_cache.py index 84a2887f527..075f1968873 100644 --- a/litellm/caching/redis_cache.py +++ b/litellm/caching/redis_cache.py @@ -1260,6 +1260,7 @@ class RedisCache(BaseCache): # typed as Any, redis python lib has incomplete type stubs for RedisCluster and does not include `delete` _redis_client: Any = self.init_async_client() # keys is str + key = self.check_and_fix_namespace(key=key) return await _redis_client.delete(key) def delete_cache(self, key):