Skip to content

fix(provider): preserve Mistral reasoning history#38453

Merged
rekram1-node merged 5 commits into
devfrom
mistral-reasoning
Jul 23, 2026
Merged

fix(provider): preserve Mistral reasoning history#38453
rekram1-node merged 5 commits into
devfrom
mistral-reasoning

Conversation

@rekram1-node

@rekram1-node rekram1-node commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Upgrade @ai-sdk/mistral to the latest AI SDK 6 release, 3.0.51
  • Preserve Mistral-native thinking and text chunks instead of concatenating reasoning and visible output
  • Retain and replay complete native thinking metadata, including signatures, closed state, tool references, and source references
  • Preserve the existing string request shape for assistant messages that contain no reasoning
  • Add provider round-trip, streaming metadata, and OpenCode LLM request-level coverage

Mistral recommends replaying the complete structured assistant message, including ThinkChunk, in multi-turn reasoning conversations: https://docs.mistral.ai/studio-api/conversations/reasoning

Follow-up to #38448.

Test plan

  • bun install --frozen-lockfile
  • bun test test/provider-mistral.test.ts in packages/core
  • bun test test/session/llm.test.ts in packages/opencode
  • bun typecheck in packages/core
  • bun typecheck in packages/opencode

@rekram1-node
rekram1-node merged commit 20589d6 into dev Jul 23, 2026
10 checks passed
@rekram1-node
rekram1-node deleted the mistral-reasoning branch July 23, 2026 17:47
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