[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) <noreply@anthropic.com>
This commit is contained in:
yuneng-jiang 2026-03-20 22:04:01 -07:00
parent 4f6b8a2a3e
commit 0ca13cc6a5

View file

@ -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,