Skip to content

fix(lint): document PLC0415 suppressions on new mcp_server_manager imports - #32666

Draft
cursor[bot] wants to merge 2 commits into
litellm_internal_stagingfrom
cursor/ci-autofix-automation-4226
Draft

fix(lint): document PLC0415 suppressions on new mcp_server_manager imports#32666
cursor[bot] wants to merge 2 commits into
litellm_internal_stagingfrom
cursor/ci-autofix-automation-4226

Conversation

@cursor

@cursor cursor Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Relevant issues

Linear ticket

Pre-Submission checklist

  • I have added meaningful tests
  • My PR passes all CI/CD checks (e.g., lint, format, unit tests)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review

Screenshots / Proof of Fix

Run logs for the failing LiteLLM Linting check on the last 'promote internal staging to main' PR (#32663, run https://github.com/BerriAI/litellm/actions/runs/29042243698):

FAIL: LIT-rule totals exceed their limit (base 999637883ce34d3944c614f38f32cfbe0bc9062d):
  LIT003: total 295 over limit 292 (this change added 3)
    litellm/proxy/_experimental/mcp_server/discoverable_endpoints.py:451
    litellm/proxy/management_endpoints/mcp_management_endpoints.py:1916
    litellm/proxy/management_endpoints/mcp_management_endpoints.py:1961

After this branch, scripts/type_discipline_gate.py --base origin/litellm_internal_staging prints

OK: every LIT rule is within its codebase ceiling (base origin/litellm_internal_staging)

and the LIT003 total across litellm/ drops back to 289 (matching the ratcheted budget)

Type

🐛 Bug Fix

Changes

The three local from litellm.proxy._experimental.mcp_server.mcp_server_manager import ... imports added in #32302 (to invalidate the per-user OAuth token cache after writing / deleting a credential) were suppressed with a bare # noqa: PLC0415, no reason. That tripped LIT003 in scripts/check_type_discipline.py, which requires # noqa: XXX # <reason>, and pushed the codebase total from 292 to 295 vs the same budget of 292. Every 'promote internal staging to main' PR then failed 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), then run make lint-budget-update so the LIT003 ceiling ratchets from 292 to 289

Open in Web View Automation 

cursoragent and others added 2 commits July 9, 2026 19:08
…ports

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>
Co-authored-by: Krrish Dholakia <krrish-berri-2@users.noreply.github.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@codspeed-hq

codspeed-hq Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing cursor/ci-autofix-automation-4226 (258c3af) with litellm_internal_staging (1d9a86e)

Open in CodSpeed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants