From 468b54fc6709722baf8f4bb1c3bcd19f025071f6 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 9 Jul 2026 19:08:53 +0000 Subject: [PATCH] fix(lint): document PLC0415 suppressions on new mcp_server_manager imports The local imports added in #32302 to invalidate the per-user OAuth token cache were suppressed with a bare `# noqa: PLC0415`, no reason. That tripped LIT003 in scripts/check_type_discipline.py and put the total at 295 vs the budget of 292, so 'promote internal staging to main' PRs fail the type-discipline gate. Annotate each of the three imports with why the local import is required (breaking the circular import between mcp_server_manager and its callers) so the gate returns to 292. Co-authored-by: Krrish Dholakia --- .../proxy/_experimental/mcp_server/discoverable_endpoints.py | 2 +- .../proxy/management_endpoints/mcp_management_endpoints.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/litellm/proxy/_experimental/mcp_server/discoverable_endpoints.py b/litellm/proxy/_experimental/mcp_server/discoverable_endpoints.py index c87e900aa2a..fd1d69b3403 100644 --- a/litellm/proxy/_experimental/mcp_server/discoverable_endpoints.py +++ b/litellm/proxy/_experimental/mcp_server/discoverable_endpoints.py @@ -448,7 +448,7 @@ async def _store_per_user_token_server_side( ) return # Don't warm Redis if DB write failed - from litellm.proxy._experimental.mcp_server.mcp_server_manager import ( # noqa: PLC0415 + from litellm.proxy._experimental.mcp_server.mcp_server_manager import ( # noqa: PLC0415 # local import to break mcp_server_manager <-> discoverable_endpoints cycle global_mcp_server_manager, ) diff --git a/litellm/proxy/management_endpoints/mcp_management_endpoints.py b/litellm/proxy/management_endpoints/mcp_management_endpoints.py index c9952b245c7..2f5b2bbf733 100644 --- a/litellm/proxy/management_endpoints/mcp_management_endpoints.py +++ b/litellm/proxy/management_endpoints/mcp_management_endpoints.py @@ -1913,7 +1913,7 @@ if MCP_AVAILABLE: expires_in=payload.expires_in, scopes=payload.scopes, ) - from litellm.proxy._experimental.mcp_server.mcp_server_manager import ( # noqa: PLC0415 + from litellm.proxy._experimental.mcp_server.mcp_server_manager import ( # noqa: PLC0415 # local import to break mcp_server_manager <-> management endpoints cycle global_mcp_server_manager, ) @@ -1958,7 +1958,7 @@ if MCP_AVAILABLE: await delete_user_credential(prisma_client, user_id, server_id) except RecordNotFoundError: pass # Already gone — treat as a successful delete - from litellm.proxy._experimental.mcp_server.mcp_server_manager import ( # noqa: PLC0415 + from litellm.proxy._experimental.mcp_server.mcp_server_manager import ( # noqa: PLC0415 # local import to break mcp_server_manager <-> management endpoints cycle global_mcp_server_manager, )