Repository navigation
feat(core): add standard model exception types - #39538
Merged
Merged
Conversation
Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
Hunter Lovell (hntrl)
approved these changes
Aug 18, 2026
Thushanth Bengre (thushanth-bengre-langchain)
previously approved these changes
Aug 18, 2026
Hunter Lovell (hntrl)
previously approved these changes
Aug 18, 2026
ccurme (ccurme)
dismissed stale reviews from Hunter Lovell (hntrl) and Thushanth Bengre (thushanth-bengre-langchain)
via
August 19, 2026 13:49
f9e12dc
# Conflicts: # libs/langchain_v1/langchain/agents/middleware/model_retry.py
ccurme (ccurme)
marked this pull request as ready for review
August 19, 2026 14:28
ccurme (ccurme)
requested review from
Eugene Yurtsev (eyurtsev) and
Mason Daugherty (mdrxy)
as code owners
August 19, 2026 14:28
ModelError retry classification
This was referenced Aug 19, 2026
This was referenced Sep 10, 2026
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.
Introduces standard exception types in langchain-core for common model failures: authentication, invalid request, rate limit, timeout, etc.
Integration packages raise subclasses that inherit from both the provider SDK's own exception type and the LangChain one, so callers catching exceptions keep working.
Each type also carries
is_retryable, which retry middleware now respects (e.g., errors from a bad API key are not retried, while rate limits or server errors are retried as before).