Skip to content

fix(mistral): distinguish response size failures - #7154

Merged
waleedlatif1 merged 1 commit into
stagingfrom
codex/mistral-response-limit-classification
Aug 27, 2026
Merged

fix(mistral): distinguish response size failures#7154
waleedlatif1 merged 1 commit into
stagingfrom
codex/mistral-response-limit-classification

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • classify oversized Mistral input files separately from oversized provider responses
  • preserve input 413 responses and report response-cap failures as upstream 502 errors
  • add route-level regression coverage for both paths

Type of Change

  • Bug fix

Testing

  • bun run lint
  • bun run apps/sim/scripts/check-block-registry.ts origin/staging
  • bun run check:audits (36/36)
  • bunx vitest run app/api/tools/mistral/parse/route.test.ts
  • bun run type-check

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 27, 2026 4:47am

Request Review

@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR distinguishes oversized Mistral inputs from oversized provider responses while preserving the existing input-limit behavior.

  • Returns 413 when a downloaded or inline input exceeds the Mistral OCR request limit.
  • Returns 502 when bounded secure-fetch response consumption exceeds its safe response limit.
  • Adds route-level regression tests for both classifications.

Confidence Score: 5/5

The 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.

Important Files Changed

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]
Loading

Reviews (1): Last reviewed commit: "fix(mistral): distinguish response size ..." | Re-trigger Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 8142208 into staging Aug 27, 2026
30 checks passed
@waleedlatif1
waleedlatif1 deleted the codex/mistral-response-limit-classification branch August 27, 2026 04:52
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