[PR #7169] [MERGED] Support Mistral Large 4 on Mistral connections #7608

Closed
opened 2026-10-24 04:05:49 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7169
Author: @SpicyMarinara
Created: 10/6/2026
Status: ✅ Merged
Merged: 10/6/2026
Merged by: @SpicyMarinara

Base: staging ← Head: feat/mistral-large-4


📝 Commits (6)

  • 29fd837 feat(mistral): support Mistral Large 4 reasoning and replies (#7164)
  • 77f7f18 fix(mistral): send a system message after an assistant turn as user (#7164)
  • 8224a00 fix(connections): read Mistral context sizes and give its test reply room (#7164)
  • 4852584 docs(changelog): note Mistral Large 4 support (#7164)
  • 817d66f fix(mistral): drop the repeated prefix, reshape tool-call ids and cover GLM 5.3 (#7164)
  • 0a459b3 docs(changelog): note prefix, tool-call and GLM 5.3 fixes for Mistral (#7164)

📊 Changes

11 files changed (+658 additions, -32 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 packages/server/src/routes/connections.routes.ts (+11 -7)
📝 packages/server/src/services/generation/generation-parameters.ts (+5 -2)
📝 packages/server/src/services/llm/providers/openai.provider.ts (+120 -19)
📝 packages/shared/src/constants/generation-parameter-relevance.ts (+9 -2)
📝 packages/shared/src/constants/model-lists.ts (+25 -0)
📝 scripts/regressions/connection-model-list.regression.ts (+9 -1)
📝 scripts/regressions/connection-test-parameters.regression.ts (+18 -0)
📝 scripts/regressions/generation-parameter-relevance.regression.ts (+31 -1)
➕ scripts/regressions/mistral-reasoning-output.regression.ts (+413 -0)
📝 scripts/regressions/provider-compat.regression.ts (+15 -0)

📄 Description

Linked issue

Closes #7164

Why this change

Mistral released Mistral Large 4 (mistral-large-4-0, 1M context, image input, optional reasoning) today. Marinara already has a Mistral provider, but this model's reasoning only accepts "high"/"none", returns replies as a list of thinking/text chunks when reasoning is on (also while streaming), and Mistral's API rejects several OpenAI-only request fields.

What changed

  • Mistral requests use Mistral's accepted reasoning values and field names, and leave out fields Mistral rejects.
  • Thinking/text chunk replies (streamed and not) are parsed into Marinara's thinking and reply instead of raw objects.
  • Context sizes come from Mistral's model list, and the connection test gets room for a reply.
  • A system message after an assistant turn is sent in a form Mistral accepts.
  • Other providers are unchanged.

Opened early so CI and CodeRabbit can start; review fixes are still being finished and will be pushed to this PR.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

Manually verify with a real Mistral API key: create a Mistral connection, pick mistral-large-4-0, run Test, then chat with reasoning off and on (streamed), and send an image. Regressions use a fake Mistral server; no real Mistral request was made.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

Summary by CodeRabbit

  • New Features
    • Added support for Mistral Large 4 and Mistral reasoning models, including model-specific Reasoning Effort options and visible thinking.
    • Updated displayed context sizes for compatible models.
  • Improvements
    • Improved Mistral connection tests and tool-call compatibility.
    • Mistral requests now omit unsupported settings and avoid replaying saved reasoning content.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/7169 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/6/2026 **Status:** ✅ Merged **Merged:** 10/6/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/mistral-large-4` --- ### 📝 Commits (6) - [`29fd837`](https://github.com/Pasta-Devs/Marinara-Engine/commit/29fd8374671b267e4b6c6450be3abe183f798ac4) feat(mistral): support Mistral Large 4 reasoning and replies (#7164) - [`77f7f18`](https://github.com/Pasta-Devs/Marinara-Engine/commit/77f7f186f2ae23f814932e6beecb39a19478e8fd) fix(mistral): send a system message after an assistant turn as user (#7164) - [`8224a00`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8224a0027db5e6d987da0116170fbedd13b108bd) fix(connections): read Mistral context sizes and give its test reply room (#7164) - [`4852584`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4852584517b899525a05967a56cafc47f1952460) docs(changelog): note Mistral Large 4 support (#7164) - [`817d66f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/817d66f5986f74ad913e151b86c9b062e6914a8d) fix(mistral): drop the repeated prefix, reshape tool-call ids and cover GLM 5.3 (#7164) - [`0a459b3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0a459b3db323562c36c9531463390161990b33fa) docs(changelog): note prefix, tool-call and GLM 5.3 fixes for Mistral (#7164) ### 📊 Changes **11 files changed** (+658 additions, -32 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `packages/server/src/routes/connections.routes.ts` (+11 -7) 📝 `packages/server/src/services/generation/generation-parameters.ts` (+5 -2) 📝 `packages/server/src/services/llm/providers/openai.provider.ts` (+120 -19) 📝 `packages/shared/src/constants/generation-parameter-relevance.ts` (+9 -2) 📝 `packages/shared/src/constants/model-lists.ts` (+25 -0) 📝 `scripts/regressions/connection-model-list.regression.ts` (+9 -1) 📝 `scripts/regressions/connection-test-parameters.regression.ts` (+18 -0) 📝 `scripts/regressions/generation-parameter-relevance.regression.ts` (+31 -1) ➕ `scripts/regressions/mistral-reasoning-output.regression.ts` (+413 -0) 📝 `scripts/regressions/provider-compat.regression.ts` (+15 -0) </details> ### 📄 Description ## Linked issue Closes #7164 ## Why this change Mistral released Mistral Large 4 (`mistral-large-4-0`, 1M context, image input, optional reasoning) today. Marinara already has a Mistral provider, but this model's reasoning only accepts `"high"`/`"none"`, returns replies as a list of `thinking`/`text` chunks when reasoning is on (also while streaming), and Mistral's API rejects several OpenAI-only request fields. ## What changed - Mistral requests use Mistral's accepted reasoning values and field names, and leave out fields Mistral rejects. - Thinking/text chunk replies (streamed and not) are parsed into Marinara's thinking and reply instead of raw objects. - Context sizes come from Mistral's model list, and the connection test gets room for a reply. - A system message after an assistant turn is sent in a form Mistral accepts. - Other providers are unchanged. _Opened early so CI and CodeRabbit can start; review fixes are still being finished and will be pushed to this PR._ ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes Manually verify with a real Mistral API key: create a Mistral connection, pick `mistral-large-4-0`, run **Test**, then chat with reasoning off and on (streamed), and send an image. Regressions use a fake Mistral server; no real Mistral request was made. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added support for Mistral Large 4 and Mistral reasoning models, including model-specific Reasoning Effort options and visible thinking. * Updated displayed context sizes for compatible models. * **Improvements** * Improved Mistral connection tests and tool-call compatibility. * Mistral requests now omit unsupported settings and avoid replaying saved reasoning content. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:05:49 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#7608
No description provided.