Skip to content

fix(lint): sort imports in mcp token_exchanger to satisfy I001 budget - #32177

Closed
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/ci-autofix-automation-4200
Closed

cursor[bot] wants to merge 1 commit into
mainfrom
cursor/ci-autofix-automation-4200

Conversation

@cursor

@cursor cursor Bot commented Jul 5, 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 requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

Screenshots / Proof of Fix

Before, scripts/ruff_strict_gate.py failed on every chore(ci): promote internal staging to main PR because the I001 total was 274, one over the 273 cap in ruff-strict-budget.json; the sole offender was litellm/proxy/_experimental/mcp_server/outbound_credentials/token_exchanger.py, whose import block wasn't sorted (litellm.proxy._experimental.mcp_server.auth.token_endpoint_auth came after the outbound_credentials.* siblings).

$ ruff check --config ruff-strict.toml --select I001 litellm/ | tail -3
Found 274 errors.

After reordering the imports so .auth.token_endpoint_auth precedes .outbound_credentials.*:

$ ruff check --config ruff-strict.toml --select I001 litellm/ | tail -3
Found 273 errors.

$ python3 scripts/ruff_strict_gate.py --base badc1414d308a206c7c8ef3fb35262ba22ea23ea
OK: every strict rule is within its codebase ceiling (base badc1414d308a206c7c8ef3fb35262ba22ea23ea)

The gate that failed on PR #32156 (run https://github.com/BerriAI/litellm/actions/runs/28722497147) now passes locally against the same base.

Type

🐛 Bug Fix

Changes

Reordered the top-of-file imports in litellm/proxy/_experimental/mcp_server/outbound_credentials/token_exchanger.py to be alphabetical within the first-party group. No runtime behavior change.

Open in Web View Automation 

Ruff's I001 strict-rule count tipped over its budget in ruff-strict-budget.json
because the token_endpoint_auth import in token_exchanger.py was placed after
sibling outbound_credentials imports, leaving the block unsorted. Reordering
puts .auth.token_endpoint_auth ahead of .outbound_credentials.*, dropping the
total I001 count back to 273 so the promote-to-main gate passes again.

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 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@yuneng-berri
yuneng-berri deleted the branch main September 13, 2026 04:28
@yuneng-berri yuneng-berri reopened this Sep 13, 2026
@devin-ai-integration
devin-ai-integration Bot changed the base branch from litellm_internal_staging to main September 23, 2026 15:51
@mateo-berri

Copy link
Copy Markdown
Contributor

#35495 already sorted these imports on main and the file has since moved, so this lint fix is not needed. Reopen if anything is missing

@mateo-berri mateo-berri closed this Nov 9, 2026
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.

4 participants