From d19dad954ec16c531dce05244478b2304d59b8b4 Mon Sep 17 00:00:00 2001 From: user <70670632+stuxf@users.noreply.github.com> Date: Fri, 1 May 2026 21:47:18 -0700 Subject: [PATCH] fix(proxy): use set lookup for permitted agent filters --- litellm/proxy/agent_endpoints/endpoints.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/litellm/proxy/agent_endpoints/endpoints.py b/litellm/proxy/agent_endpoints/endpoints.py index 32d9a7f2721..374c123c332 100644 --- a/litellm/proxy/agent_endpoints/endpoints.py +++ b/litellm/proxy/agent_endpoints/endpoints.py @@ -1005,8 +1005,9 @@ async def get_agent_daily_activity( permitted_agent_ids = [a.agent_id for a in owned_records] if agent_ids_list: + permitted_agent_id_set = set(permitted_agent_ids) agent_ids_list = [ - aid for aid in agent_ids_list if aid in permitted_agent_ids + aid for aid in agent_ids_list if aid in permitted_agent_id_set ] else: agent_ids_list = list(permitted_agent_ids)