From 0ca13cc6a5ac89343eb5531d9dfee6536a6a644e Mon Sep 17 00:00:00 2001 From: yuneng-jiang Date: Fri, 20 Mar 2026 22:04:01 -0700 Subject: [PATCH] [Fix] Invalidate team cache after extra_permissions update Ensures permission changes take effect immediately instead of waiting for cache TTL expiry. Co-Authored-By: Claude Opus 4.6 (1M context) --- litellm/proxy/management_endpoints/team_endpoints.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/litellm/proxy/management_endpoints/team_endpoints.py b/litellm/proxy/management_endpoints/team_endpoints.py index 15700ac0d55..d6b0a4a6836 100644 --- a/litellm/proxy/management_endpoints/team_endpoints.py +++ b/litellm/proxy/management_endpoints/team_endpoints.py @@ -2496,6 +2496,11 @@ async def team_member_update( data={"members_with_roles": json.dumps(_db_team_members_perms)}, # type: ignore ) + # Invalidate team cache so permission changes take effect immediately + from litellm.proxy.proxy_server import user_api_key_cache + + user_api_key_cache.delete_cache(key="team_id:{}".format(data.team_id)) + return TeamMemberUpdateResponse( team_id=data.team_id, user_id=received_user_id,