Skip to content

fix(ai): preserve Mistral and Cohere system parts - #52890

Merged
rekram1-node merged 2 commits into
v2from
system-text-parts
Oct 3, 2026
Merged

rekram1-node merged 2 commits into
v2from
system-text-parts

Conversation

@rekram1-node

Copy link
Copy Markdown
Collaborator

Issue for this PR

No linked issue.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Preserve multiple initial system text parts as ordered content arrays in native Mistral Chat and Cohere Chat instead of joining them with added newlines. Update Mistral's system-message schema to accept text arrays. Single-part requests retain their string shape, and absent system instructions remain omitted. OpenAI-compatible routes and chronological system updates are unchanged.

How did you verify your code works?

  • Updated existing native request tests to exercise multiple system parts and embedded newlines. No new tests added.
  • Replayed existing Mistral and Cohere fixtures unchanged.
  • bun test test/provider/mistral-chat.test.ts test/provider/cohere.test.ts test/provider/mistral.recorded.test.ts test/provider/cohere.recorded.test.ts: 37 pass.
  • bun run check: passed with existing repository lint warnings.

Screenshots / recordings

Not applicable; request payload change only.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@rekram1-node
rekram1-node merged commit 7ced932 into v2 Oct 3, 2026
9 checks passed
@rekram1-node
rekram1-node deleted the system-text-parts branch October 3, 2026 04:36
Ichinose-Kazuki pushed a commit to Ichinose-Kazuki/opencode that referenced this pull request Oct 7, 2026
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