Skip to content

fix(mistral): restore mistral configs for v2 version#3138

Merged
icecrasher321 merged 1 commit intostagingfrom
fix/restore-mistral
Feb 5, 2026
Merged

fix(mistral): restore mistral configs for v2 version#3138
icecrasher321 merged 1 commit intostagingfrom
fix/restore-mistral

Conversation

@icecrasher321
Copy link
Collaborator

@icecrasher321 icecrasher321 commented Feb 4, 2026

Summary

Don't break backwards compat for v2 mistral block.

Type of Change

  • Bug fix

Testing

Tested manually

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)
Cursor Bugbot found 1 potential issue for commit 0db8777

@vercel
Copy link

vercel bot commented Feb 4, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Feb 4, 2026 11:49pm

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 4, 2026

Greptile Overview

Greptile Summary

This PR restores backwards compatibility for the Mistral v2 block configuration that was changed in a previous update. The key changes:

  • V2 Block (mistral_parse_v2): Restored to use filePath subblock (not fileReference) for advanced mode, with smart type-based handling (object → fileUpload, string → filePath). Hidden from toolbar to prevent new usage.
  • V2 Tool (mistral_parser_v2): Simplified to reuse V1 tool's flexible parameter handling and request logic, changing input type from MistralParserV2Input (strict UserFile) to MistralParserInput (flexible optional params).
  • V3 Block/Tool (mistral_parse_v3): Introduced as the new pattern using fileReference subblock with normalizeFileInput() for proper UserFile handling. Visible in toolbar for new workflows.

The approach maintains compatibility for existing v2 workflows while steering new users toward v3 with better file normalization.

Confidence Score: 4/5

  • Safe to merge with minor concerns about type signature changes
  • The PR correctly implements backwards compatibility by restoring v2 configs and introducing v3. The type signature change in v2 tool from MistralParserV2Input to MistralParserInput is technically a breaking change at the type level but maintains runtime compatibility. All changes follow established patterns and properly handle file inputs.
  • Pay attention to apps/sim/tools/mistral/parser.ts for the tool input type changes

Important Files Changed

Filename Overview
apps/sim/blocks/blocks/mistral_parse.ts Restores v2 block config for backwards compatibility, introduces v3 with new file handling
apps/sim/tools/mistral/parser.ts Simplifies v2 tool to reuse v1 implementation, adds v3 tool with UserFile normalization

Sequence Diagram

sequenceDiagram
    participant User
    participant V2Block as MistralParseV2Block
    participant V3Block as MistralParseV3Block
    participant V2Tool as mistralParserV2Tool
    participant V3Tool as mistralParserV3Tool
    participant API as Mistral API

    Note over V2Block,V3Block: Backwards Compatibility Approach

    alt V2 Block (Hidden, Legacy)
        User->>V2Block: fileUpload (object) OR filePath (string)
        V2Block->>V2Block: Smart handling: typeof check
        alt Object Input
            V2Block->>V2Tool: parameters.fileUpload = documentInput
        else String Input
            V2Block->>V2Tool: parameters.filePath = documentInput
        end
        V2Tool->>V2Tool: Reuses V1 tool logic (flexible params)
        V2Tool->>API: POST /api/tools/mistral/parse
        API-->>V2Tool: OCR Result (raw Mistral format)
        V2Tool-->>V2Block: pages, model, usage_info, document_annotation
        V2Block-->>User: Result
    end

    alt V3 Block (Visible, New Pattern)
        User->>V3Block: fileUpload OR fileReference
        V3Block->>V3Block: normalizeFileInput(params, {single: true})
        V3Block->>V3Tool: parameters.file = UserFile (normalized)
        V3Tool->>V3Tool: Validates UserFile object
        V3Tool->>API: POST /api/tools/mistral/parse
        API-->>V3Tool: OCR Result (raw Mistral format)
        V3Tool-->>V3Block: pages, model, usage_info, document_annotation
        V3Block-->>User: Result
    end
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@icecrasher321 icecrasher321 merged commit fce566c into staging Feb 5, 2026
12 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/restore-mistral branch February 5, 2026 03:46
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