fix(mistral): distinguish response size failures - #7154
Merged
waleedlatif1 merged 1 commit intoAug 27, 2026
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Greptile SummaryThe PR distinguishes oversized Mistral inputs from oversized provider responses while preserving the existing input-limit behavior.
Confidence Score: 5/5The PR appears safe to merge with no actionable correctness, security, or repository-rule issues identified. Input-size exceptions are intercepted before the provider call and remain 413 responses, while secure-fetch response-size exceptions retain their type through response consumption and are correctly translated to 502.
|
| Filename | Overview |
|---|---|
| apps/sim/app/api/tools/mistral/parse/route.ts | Separates locally handled input-size failures from response-cap failures reaching the outer route error boundary; no actionable defect identified. |
| apps/sim/app/api/tools/mistral/parse/route.test.ts | Adds focused regression coverage for downloaded-input 413 and oversized-provider-response 502 behavior. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Mistral parse request] --> B{Input exceeds request limit?}
B -- Yes --> C[Return 413]
B -- No --> D[Call Mistral OCR]
D --> E{Provider response exceeds safe cap?}
E -- Yes --> F[Return 502]
E -- No --> G[Return parsed provider result]
Reviews (1): Last reviewed commit: "fix(mistral): distinguish response size ..." | Re-trigger Greptile
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.
Summary
413responses and report response-cap failures as upstream502errorsType of Change
Testing
bun run lintbun run apps/sim/scripts/check-block-registry.ts origin/stagingbun run check:audits(36/36)bunx vitest run app/api/tools/mistral/parse/route.test.tsbun run type-checkChecklist