Repository navigation
Don't crash startup when litellm ships a new exception type - #5945
Open
inchang-ing wants to merge 1 commit into
Open
inchang-ing wants to merge 1 commit into
inchang-ing wants to merge 1 commit into
Conversation
LiteLLMExceptions._load has a strict parameter but never reads it: the completeness check raised ValueError unconditionally on the user-facing startup path, so any litellm release that adds a new exception type broke aider for everyone (e.g. CallerCredentialAuthenticationError). Honor the parameter: strict=True keeps the loud check, the default path warns and moves on. Unmapped errors are deliberately not registered into the catch tuple, because dir(litellm) also surfaces re-exported third-party errors and widening the tuple would catch unrelated bugs. Closes Aider-AI#5944
|
|
inchang-ing
added a commit
to inchang-ing/zcode-PR
that referenced
this pull request
Nov 4, 2026
…down#1688 spelling fix staged - Aider-AI/aider#5945: honor LiteLLMExceptions._load(strict); warn-only for unmapped litellm errors; pre-fail reproed on litellm 1.108.0, 9/9 tests, EVIDENCE_OK; awaiting account-holder CLA (web OAuth) - inbox: 101 items dispositioned to 0 pending (gates 32 / same-repo cap 29 / collision yields 20 of 24 checked); dispositions 174 -> 273 - markdown#1688 pyspelling red triaged: .spell-dict +3 commit b878783 staged locally, push awaits owner (repo bans autonomous agent PR updates)
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5944
Problem
litellm added new exception types (
CallerCredentialAuthenticationErroramong them), and every aider invocation now dies at startup with:LiteLLMExceptions._loadalready takes astrictparameter, but never reads it — the completeness check raises unconditionally, on the user-facing startup path (aider/coders/base_coder.py,aider/models.py), for every user, the moment litellm ships an exception that is not in aider's list.Fix
strictparameter:strict=Truekeeps the loudValueErroras the development/CI drift check; the default lenient path now emits aUserWarningand moves on.exceptions:dir(litellm)also surfaces re-exported third-party errors (with litellm 1.108.0 that includes pydantic'sValidationErrorandzoneinfo'sZoneInfoNotFoundError), and wideningexceptions_tuple()would start catching those inside the send loops and mask unrelated bugs. Unmapped litellm errors keep flowing through the existing unmapped path inget_ex_info(ExInfo(None, None, None)).EXCEPTIONSlist untouched — this PR is the mechanism fix.Verification
LiteLLMExceptions()reproduces exactly the issue's failure:ValueError: CallerCredentialAuthenticationError is in litellm but not in aider's exceptions list.tests/basic/test_exceptions.pypasses 9/9, including two new tests:test_new_litellm_error_does_not_break_startup— a monkeypatched brand-new litellm error warns but does not crash construction and stays out of the catch tuple. Verified to fail on the unpatched code by stashing the fix and re-running.test_strict_load_still_enforces_mapping—strict=Truestill raisesValueErrorfor unmapped names.black 23.3.0 --line-length 100 --preview,flake8 7.1.0andisort 5.12.0(the repo's pre-commit pins) are all clean on the two touched files.Prepared with the assistance of an AI coding agent (an automated pipeline working on behalf of the account owner); the account owner submits and stands behind this PR.