Skip to content

fix(ai): defer Mistral thinking metadata until block end - #52008

Merged
rekram1-node merged 1 commit into
v2from
mistral-streaming
Sep 29, 2026
Merged

rekram1-node merged 1 commit into
v2from
mistral-streaming

Conversation

@rekram1-node

Copy link
Copy Markdown
Collaborator

Summary

  • Buffer Mistral native thinking units with append-only parser state rather than copying the accumulated array per chunk.
  • Keep reasoning deltas incremental and attach the complete native thinking block once at reasoning end for replay.
  • Preserve metadata-only blocks, native fields, and text/thinking ordering.

Verification

  • bun test test/provider/mistral-chat.test.ts test/provider/mistral.recorded.test.ts in packages/ai (23 passed)
  • bun test --timeout 30000 --only-failures in packages/ai (1,607 passed, 28 skipped)
  • bun typecheck in packages/ai and bun run check at the root
  • Local-only 1,024-chunk stream: 1,024 incremental deltas without cumulative metadata, one final native block with all 1,024 units

@rekram1-node
rekram1-node merged commit 3126808 into v2 Sep 29, 2026
10 checks passed
@rekram1-node
rekram1-node deleted the mistral-streaming branch September 29, 2026 16:38
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