From 433c804a6cfec9c6674872857f96b435f69f4d96 Mon Sep 17 00:00:00 2001 From: yassin Date: Thu, 17 Sep 2026 19:32:39 +0000 Subject: [PATCH] refactor(agents): mark Callable loader aliases for the type discipline gate Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- litellm/proxy/agent_endpoints/auth/agent_access_groups.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/litellm/proxy/agent_endpoints/auth/agent_access_groups.py b/litellm/proxy/agent_endpoints/auth/agent_access_groups.py index 4a579de679e..f5adc897e11 100644 --- a/litellm/proxy/agent_endpoints/auth/agent_access_groups.py +++ b/litellm/proxy/agent_endpoints/auth/agent_access_groups.py @@ -18,8 +18,9 @@ from litellm._logging import verbose_proxy_logger from litellm.proxy._types import LiteLLM_AccessGroupTable from litellm.types.agents import AgentResponse -AgentLoader: TypeAlias = Callable[[str], Awaitable[AgentResponse | None]] -AccessGroupLoader: TypeAlias = Callable[[str], Awaitable[LiteLLM_AccessGroupTable | None]] +AgentLoader: TypeAlias = Callable[[str], Awaitable[AgentResponse | None]] # mutable-ok: Callable parameter syntax +LoadedAccessGroup: TypeAlias = LiteLLM_AccessGroupTable | None +AccessGroupLoader: TypeAlias = Callable[[str], Awaitable[LoadedAccessGroup]] # mutable-ok: Callable parameter syntax @dataclass(frozen=True, slots=True) @@ -38,7 +39,7 @@ async def _load_agent(agent_id: str) -> AgentResponse | None: return await get_agent_with_read_through(agent_id) -async def _load_access_group(access_group_id: str) -> LiteLLM_AccessGroupTable | None: +async def _load_access_group(access_group_id: str) -> LoadedAccessGroup: from litellm.proxy.auth.auth_checks import get_access_object from litellm.proxy.proxy_server import prisma_client, proxy_logging_obj, user_api_key_cache