Skip to content

Revert "fix(proxy): improve auth exception logging levels and add structured context" - #22187

Merged
Sameerlite merged 1 commit into
litellm_oss_staging_02_26_2026from
revert-22099-fix/improve-auth-exception-logging
Feb 26, 2026
Merged

Revert "fix(proxy): improve auth exception logging levels and add structured context"#22187
Sameerlite merged 1 commit into
litellm_oss_staging_02_26_2026from
revert-22099-fix/improve-auth-exception-logging

Conversation

@Sameerlite

Copy link
Copy Markdown
Contributor

Reverts #22099

@vercel

vercel Bot commented Feb 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Building Building Preview, Comment Feb 26, 2026 1:09pm

Request Review

@Sameerlite
Sameerlite merged commit 81455db into litellm_oss_staging_02_26_2026 Feb 26, 2026
2 of 3 checks passed
@greptile-apps

greptile-apps Bot commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR cleanly reverts PR #22099, which introduced structured logging context and warning-vs-error log level differentiation in the proxy auth exception handler.

  • Restores the original single verbose_proxy_logger.exception() call for all auth errors in _handle_authentication_error(), removing the conditional warning/error log level split
  • Removes the abbreviate_api_key import that was only needed by the reverted structured logging logic
  • Removes four test functions that validated the now-reverted behavior (log level selection, structured context, None API key handling)
  • Verified that both files match their exact pre-fix(proxy): improve auth exception logging levels and add structured context #22099 state — this is a clean, no-surprise revert

Confidence Score: 5/5

  • This PR is a clean, auto-generated revert with no manual modifications — safe to merge.
  • Both changed files match their exact pre-PR-fix(proxy): improve auth exception logging levels and add structured context #22099 state byte-for-byte. No custom logic was introduced, no imports were missed, and the remaining tests still cover the core exception handler functionality. The revert only removes a logging enhancement, with zero impact on functional behavior.
  • No files require special attention.

Important Files Changed

Filename Overview
litellm/proxy/auth/auth_exception_handler.py Clean revert of structured logging changes from PR #22099. Restores original verbose_proxy_logger.exception() call for all auth errors, removing the warning/error level split and structured context fields. Import of abbreviate_api_key correctly removed.
tests/test_litellm/proxy/auth/test_auth_exception_handler.py Removes four test functions added in PR #22099 that validated the now-reverted structured logging behavior (warning vs error levels, structured context fields, None API key handling). Remaining three tests cover DB unavailable handling, budget exceeded, and route passing — all still valid.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["Auth Exception Raised"] --> B{"DB connection error &<br/>allow_requests_on_db_unavailable?"}
    B -- Yes --> C["Return UserAPIKeyAuth<br/>(failed-to-connect-to-db)"]
    B -- No --> D["Log via verbose_proxy_logger.exception()<br/>(all errors treated equally)"]
    D --> E["Call post_call_failure_hook"]
    E --> F{"Exception type?"}
    F -- BudgetExceededError --> G["Raise ProxyException<br/>(budget_exceeded)"]
    F -- HTTPException --> H["Raise ProxyException<br/>(auth_error)"]
    F -- ProxyException --> I["Re-raise ProxyException"]
    F -- Other --> J["Raise ProxyException<br/>(auth_error, 401)"]
Loading

Last reviewed commit: 95b8fb8

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@ishaan-berri
ishaan-berri deleted the revert-22099-fix/improve-auth-exception-logging branch March 26, 2026 22:30
fzowl pushed a commit to fzowl/litellm that referenced this pull request Jun 24, 2026
…e-auth-exception-logging

Revert "fix(proxy): improve auth exception logging levels and add structured context"
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.

1 participant