Repository navigation
Only map Mistral 3051 to ModelContextWindowExceededError on context length overflow - #12864
Closed
princejain756 wants to merge 1 commit into
Closed
princejain756 wants to merge 1 commit into
princejain756 wants to merge 1 commit into
Conversation
…message indicates context length
Contributor
|
Thanks for your interest in this issue! To avoid duplicate effort, please wait to be assigned before opening a PR. This PR has been closed automatically because issue #12861 is not assigned to you. If you believe this was closed in error, please comment on the issue and a maintainer can reassess. |
Contributor
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Mistral error 3051 now maps to context-window overflow only when the message identifies that condition; other invalid arguments retain standard HTTP error categorization. The narrowly scoped change includes regression coverage and does not alter successful requests or stored data. You can add or adjust custom eligibility rules. Learn more. |
1 of 2 tasks
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.
Fixes #12861
Mistral returns code
3051for generic invalid-request errors too (like an invalid tool name), not only when the prompt overflows the context window. Matching3051unconditionally meant every 400 with code3051raisedModelContextWindowExceededErrorinstead ofModelHTTPError.Scoped the
3051check inmistral.pyso it only maps toModelContextWindowExceededErrorwhen the message mentionsmaximum context length(same patternxai.pyuses for gRPCINVALID_ARGUMENT), and added a test intests/models/test_error_categories.py.