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 <krrish-berri-2@users.noreply.github.com>
This commit is contained in:
Cursor Agent 2026-07-09 19:08:53 +00:00
parent 1d9a86eac4
commit 468b54fc67
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

View file

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

View file

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