Skip to content

Conversation

@daniel-lxs
Copy link
Member

@daniel-lxs daniel-lxs commented Jan 29, 2026

Summary

Migrate the Mistral provider from using the direct @mistralai/mistralai SDK to the AI SDK's dedicated @ai-sdk/mistral package.

Changes

1. src/api/providers/mistral.ts

  • Replaced the direct @mistralai/mistralai SDK with @ai-sdk/mistral
  • Uses createMistral to create the provider instance
  • Uses streamText and generateText from the AI SDK v6 for completions
  • Leverages shared AI SDK utilities for consistent message/tool handling
  • Maintains support for Codestral models with custom base URL
  • Follows the same pattern as the Cerebras handler

2. src/package.json

  • Added @ai-sdk/mistral: ^3.0.0 to dependencies (v3.x required for AI SDK v6 compatibility)

3. src/api/providers/__tests__/mistral.spec.ts

  • Complete test suite with 23 tests passing

Testing

  • All unit tests pass (5325 passed)
  • TypeScript compilation successful

Linear

Resolves EXT-692


Important

Migrates Mistral provider to use @ai-sdk/mistral, updating mistral.ts and tests for AI SDK v6 compatibility.

  • Behavior:
    • Migrates Mistral provider to use @ai-sdk/mistral in mistral.ts.
    • Utilizes createMistral, streamText, and generateText from AI SDK v6.
    • Supports Codestral models with custom base URL.
  • Testing:
    • Updates mistral.spec.ts to mock @ai-sdk/mistral and test new behavior.
    • Ensures all 23 tests pass.
  • Dependencies:
    • Adds @ai-sdk/mistral: ^3.0.0 to package.json dependencies.

This description was created by Ellipsis for 6e87953. You can customize this summary. It will automatically update as commits are pushed.

- Replace @mistralai/mistralai SDK with @ai-sdk/mistral v3.0.0
- Use streamText and generateText from AI SDK v6
- Add comprehensive test suite with 23 tests
- Maintain support for Codestral models with custom base URL

EXT-692
@daniel-lxs daniel-lxs requested review from cte, jr and mrubens as code owners January 29, 2026 22:59
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. Enhancement New feature or request labels Jan 29, 2026
@roomote
Copy link
Contributor

roomote bot commented Jan 29, 2026

Rooviewer Clock   See task on Roo Cloud

Review completed. All issues have been resolved.

  • Default temperature changed from 1 to 0 due to unreachable MISTRAL_DEFAULT_TEMPERATURE fallback (comment)
Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

Address review comment - ensure temperature defaults to 1 (MISTRAL_DEFAULT_TEMPERATURE)
instead of 0 from getModelParams to match original behavior.
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 30, 2026
@mrubens
Copy link
Collaborator

mrubens commented Jan 30, 2026

@roomote please fix the compile and knip errors

@roomote
Copy link
Contributor

roomote bot commented Jan 30, 2026

Coderoo Clock   See task on Roo Cloud

Fixed the reported issues. All local checks passed.

View commit | Revert commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request lgtm This PR has been approved by a maintainer size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

4 participants