Skip to content

feat(assistant): add Mistral provider with tool-call compatibility - #3185

Merged
Mavrick-F merged 3 commits into
opengeos:mainfrom
Mavrick-F:feat/mistral-provider
Nov 28, 2026
Merged

Mavrick-F merged 3 commits into
opengeos:mainfrom
Mavrick-F:feat/mistral-provider

Conversation

@Mavrick-F

@Mavrick-F Mavrick-F commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds Mistral AI's first-party API to the Assistant provider picker and CLI, using MISTRAL_API_KEY and the existing streamed OpenAI-compatible transport. The default is the generally available mistral-small-2603; Large 4 is a preview whose training exceptions make it unsuitable as the default. The same privacy description appears in settings and the guide; the guide explains the EU address override.

An older first-party Mistral model card requires nine alphanumeric characters for tool-call IDs; this preset applies that compatible format to all requests. Outgoing requests remap call IDs and matching results together, including native messages from another compatible provider, without changing conversation storage or requests to other providers. Ordinals avoid hash/truncation collisions. Picture captions retain original IDs as provenance.

The parser also accepts Mistral's documented typed text/thinking chunks, showing only visible text while preserving the native blocks and signatures for replay. It handles mixed string/array stream chunks and whole replies. Unsupported display parts, such as references, produce one counted transcript notice per type while their native payload remains intact. Thinking stays out of the displayed answer, and empty stream deltas do not add empty text blocks.

As with other keyed presets, environment-based selection uses Mistral when its key is set and no earlier preset has a key.

No affiliation with Mistral. Operator: Mistral AI SAS, France. Primary sources: model and capabilities, chat API, commercial terms §4, retention policy §5 (chat API content is normally kept for 30 rolling days for abuse monitoring, unless ZDR is activated), training controls, and the first-party model-card ID requirement. No other project's code was followed.

Shared preset/transport reaches desktop, browser, CLI and phone. Python/MCP/plugins use existing commands and need no new interface. No project-data copies or undoable map mutation are added; switching provider uses existing conversation behavior.

Testing

Tests cover native/cross-provider call/result pairing, distinct IDs and isolation from OpenAI, plus model-list authentication and typed-content parsing/preview/replay. Independent review completed; formatting and local preflight passed. Full fork CI passed on be0e0483910ef2cd139f3a3e33c60ebada75e57f in 30 minutes. The three new protocol fixtures passed locally (about 0.018 seconds combined on warm runs, including process startup); the typed-stream regression also failed with the old parser and passed with this change. The additional transcript-notice regression covers streamed and whole replies, exact per-type counts and native preservation; it fails when either notice reporting or empty-delta filtering is reverted. It takes 0.032–0.043 seconds on warm runs, including startup, versus 0.006–0.008 seconds with that test skipped. Formatting, preflight and targeted translation-template checks passed. Rendered and inspected the actual Mistral settings and before/after transcript using a synthetic response. Browser-origin CORS preflight returned 200 and allows Authorization and Content-Type. No API key was available, so authenticated model, image and tool streaming have not been live-tested. In particular, tool-returned image role ordering and fragmented thinking/signature replay remain unverified against the live service.

UI evidence

Mistral settings

Before the content notice:

Reply before unsupported-content notice

After:

Reply with the counted reference-content notice

Related issue

Follows merged #3171. This diff now contains only the Mistral addition and its protocol support. Azure is outside this scope.

Summary by CodeRabbit

  • New Features
    • Added Mistral as an AI assistant provider, with support in the CLI and web app.
    • Added a private-routing option for OpenRouter requests.
  • Bug Fixes
    • Improved handling of streamed responses containing text and typed content, preserving visible replies and supported content.
    • Added transcript notices when some typed content cannot be displayed or OpenRouter has no endpoint matching the data policy.
  • Documentation
    • Updated the assistant and CLI guides with Mistral provider details and availability.

@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

This change adds Mistral to assistant provider presets and listings. OpenAI-compatible stream parsing and replay now handle typed content. Mistral requests map tool-call IDs, OpenRouter requests can apply a data-collection setting, and the agent records notices for undisplayed content.

Changes: Assistant provider support

Layer / File(s) Summary
Mistral preset and listings
crates/assistant/src/provider.rs, crates/assistant/src/tests.rs, README.md, apps/rustgis-cli/src/main.rs, docs/cli.md, docs/user-guide/assistant.md
The provider preset adds Mistral with its model and key configuration. The README, CLI help, and user guide add Mistral to provider listings and information. Tests cover provider selection.
Typed content parsing and transcript notices
crates/assistant/src/provider.rs, crates/assistant/src/agent.rs, crates/assistant/src/tests.rs
Stream assembly, previews, reply parsing, and replay handle typed content. Replies include notes for undisplayed content, which the agent adds to transcript entries. Tests cover visible text, typed blocks, and notices.
Provider-specific request handling
crates/assistant/src/provider.rs, crates/assistant/src/tests.rs
Mistral requests map tool-call IDs and result references. Non-Mistral replay converts typed arrays to visible text. OpenRouter requests apply provider.data_collection when private routing is enabled. Tests cover ID mapping and model-list authentication.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Suggested reviewers: gpt-cmdr, giswqs

Merge Risk: Minimal · up to be0e0

This adds Mistral as an assistant provider and handles typed reply content. No concrete merge-blocking defect was established. Authenticated live behavior with Mistral, such as replay of streamed thinking blocks, was not tested against the service.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: adding a Mistral provider to the Assistant. It also names the tool-call ID compatibility work, which the changeset implements (ID remapping for Mistral requests, typed…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description follows the template's Summary, Testing, UI evidence, and Related issue sections. The Summary explains the Mistral provider addition, its default model, the tool-call ID compatibility …
Full details: Title check

Explanation

The title names the main change: adding a Mistral provider to the Assistant. It also names the tool-call ID compatibility work, which the changeset implements (ID remapping for Mistral requests, typed-content parsing, and related tests). It follows the conventional commit style and is a single line with no file lists or emojis.

Full details: Description check

Explanation

The description follows the template's Summary, Testing, UI evidence, and Related issue sections. The Summary explains the Mistral provider addition, its default model, the tool-call ID compatibility handling, and the typed-content parsing. The Testing section lists the new tests, the CI run, and the local checks, and it names the live-testing gaps. The UI evidence section includes before and after screenshots for the transcript notice and a settings screenshot. The Related issue section links the prior merged issue #3171 as context. The template's 'No visible UI change' line does not apply, because the PR adds visible settings and transcript notices, so the UI section is correctly filled in. The description is substantially complete. One gap is that the Related issue entry does not use a Closes or Part of reference to a tracked issue, but the author states that the diff follows merged #3171, which gives the context.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks the stream for text,
While Mistral joins the provider list.
Typed blocks keep their native form,
Call IDs take a numbered turn.
Transcript notes record what stayed unseen.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 24bd5908-a675-4d9c-8af9-3d943e2a5893
Commits

Reviewing files that changed from the base of the PR and between 00c9c26 and be0e048.

Files selected for processing: 4

  • crates/assistant/src/agent.rs
  • crates/assistant/src/provider.rs
  • crates/assistant/src/tests.rs
  • docs/user-guide/assistant.md

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.

@github-actions

Copy link
Copy Markdown
Contributor

Code review

Scope: PR #3185 (Mistral provider). The diff also carries the changes from the stacked PR #3171 (provider descriptions, the OpenRouter privacy routing, the CONTRIBUTING policy and the README rewording). I reviewed them as they appear in this diff. I could not build or run the tests here, so this review is from reading the code.

Bugs

  • None found. I checked the streamed-content merge (openai_assembled), the typed-content readers (openai_reply, StreamPreview), the Mistral call-id remapping (ordinal ids stay unique across the request), and the serde indexing in the replay path (guarded by is_array on an object). No crash path in non-test code.

Security

  • None found. The OpenRouter privacy filter is on by default on every path I traced: desktop (load_config), CLI (Config::from_env), the chat request, the summary request (agent.rs:661) and the subagent request, which all go through chat_request. The only opt-out is an explicit "off" preference or the env var.

Performance

  • None significant. The remapping and content merge are linear in the message and stream size.

Quality

  • README drops three providers (README.md:117, high confidence). The AI Assistant row no longer names Requesty, TrustedRouter or Opper, though all three are still presets and documented. Restore them next to Mistral.
  • 404 note ignores the setting (agent.rs:770, medium). The "Check Private routing" text also shows when Private routing is already off, and the privacy substring match is broad.
  • Typed parts dropped from the visible reply (provider.rs:1286, low to medium). Non-text parts are discarded with no notice. The native message keeps them, so nothing is lost from the conversation. Whether "Never silent" covers display text is for the author to say.
  • Privacy setting read inconsistently (ui-egui/src/assistant.rs:185, medium). The desktop overwrites the env var's value, so RUSTGIS_OPENROUTER_DATA_COLLECTION=allow has no effect in the app. The CLI with --use-saved-secrets does not read the saved preference. The default is safe in both, but the docs and the code disagree.

AGENTS.md

  • None raised. I checked: no unwrap or expect in new non-test code; UI strings go through tl!, and the new note is in NOTE_TEMPLATES; no command was added or changed, so the command snapshot is unaffected; no wasm-only or desktop-only branch changed; no new asset files; the Mistral preset meets the CONTRIBUTING criteria as described in the PR body.

Twins checked

  • Read routes: openai_request covers chat, summary and subagent requests. The three reply readers all handle typed content.
  • Constructors: every Config literal in the diff has the new field. I found no other literal in the tree.
  • Provider host lists: none outside the presets, so nothing was missed.

Earlier review threads

  • None on this PR, so no concerns were left alone.

Four inline comments are filed: README, agent.rs:770, provider.rs:1286, assistant.rs:185.

Change size

Compared: the whole PR against main (merge base af6e24c to PR head 0d2b19f).

Measure Value
Files changed 12 (0 added, 12 modified, 0 removed, 0 renamed)
Size before 814.9 KB
Size after 835.6 KB
Total size change +20.7 KB
Path Before After Change
crates/assistant/src/provider.rs 77.6 KB 84.6 KB +7.0 KB
crates/assistant/src/tests.rs 303.3 KB 308.3 KB +5.0 KB
docs/user-guide/assistant.md 31.1 KB 35.6 KB +4.5 KB
crates/ui-egui/src/assistantpane.rs 108.6 KB 110.3 KB +1.7 KB
CONTRIBUTING.md 4.8 KB 6.1 KB +1.3 KB
crates/assistant/src/agent.rs 64.3 KB 64.9 KB +660 B
crates/ui-egui/src/assistant.rs 51.4 KB 51.8 KB +405 B
crates/ui-egui/src/assistantpictures.rs 19.7 KB 19.7 KB +38 B
crates/ui-egui/src/localagents.rs 43.3 KB 43.4 KB +38 B
docs/cli.md 13.6 KB 13.6 KB +11 B
apps/rustgis-cli/src/main.rs 69.4 KB 69.4 KB +8 B
README.md 27.8 KB 27.8 KB −4 B

@Mavrick-F

Copy link
Copy Markdown
Member Author

The README’s “OpenRouter and other gateways” wording is intentional in #3171; Requesty, TrustedRouter and Opper remain available and documented.

The privacy note also names OpenRouter account settings, which can reject a request while the local checkbox is off. Narrowing the message match further is left for the release quality pass, as recorded on #3171.

Typed thinking/signature blocks are retained in the native conversation for replay. They are intentionally excluded from answer text; the regression checks both visible text and preserved native blocks.

The privacy controls have separate documented scopes: desktop uses its saved checkbox, while CLI uses RUSTGIS_OPENROUTER_DATA_COLLECTION. --use-saved-secrets does not import every desktop setting. Keeping the environment override CLI-only avoids persisting a temporary desktop opt-out through an unrelated settings save.

@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-3185/
Web app https://preview.rustgis.app/pr-3185/app/
Commit be0e048

GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the preview label (once per commit).

@Mavrick-F
Mavrick-F force-pushed the feat/mistral-provider branch from 0d2b19f to 00c9c26 Compare November 28, 2026 03:37
Some(Value::String(text)) => text.clone(),
Some(Value::Array(parts)) => parts
.iter()
.filter(|p| p.get("type").and_then(Value::as_str) == Some("text"))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

openai_content_text keeps only type: "text" parts and drops every other typed part without a trace. The visible reply and the stream preview therefore lose anything else a compatible server sends in content, such as a reference or citation chunk. AGENTS asks that a reader which drops data says what and how much (Session::notify or ToolResult::messages, one notice per kind with a count), and that lossy input has a test that expects the notice. Either count the skipped non-text parts and report them, or pin the chosen behaviour in a test. Confidence is low-to-medium: RustGIS sends only function tools, so I'm not sure the Mistral API returns these parts on this path.

Category: bug

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in be0e048. Unsupported display parts now generate one counted transcript notice per type, including for summary replies, while the native payload remains intact. Known thinking metadata does not generate a notice. The regression exercises streamed and whole replies through the agent, checks the exact count and native content, and fails with reporting reverted. Full fork CI passed. Mistral’s citation documentation confirms reference chunks can accompany function-tool replies.

(Value::Array(parts), Value::Array(more)) => parts.extend(more.iter().cloned()),
(Value::Array(parts), Value::String(text)) => parts.push(json!({"type":"text", "text":text})),
(Value::String(text), Value::Array(parts)) => {
let mut all = vec![json!({"type":"text", "text":text})];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the first content delta is an empty string (common in the opening chunk of a stream), this arm stores an empty {"type":"text","text":""} part. That part is replayed to Mistral in the native message. I can't confirm from here whether Mistral rejects empty text chunks, but skipping empty text avoids sending one for no reason. Small fix:

Suggested change
let mut all = vec![json!({"type":"text", "text":text})];
let mut all = if text.is_empty() { Vec::new() } else { vec![json!({"type":"text", "text":text})] };

Category: quality

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in be0e048 by ignoring empty string deltas before assembly. The regression opens and closes a typed stream with empty deltas and checks the exact native payload. It fails with the filter reverted. Full fork CI passed.

Comment thread docs/user-guide/assistant.md Outdated
| Requesty | A UK gateway to hundreds of models, which can move to another service when one fails. It logs requests up to 30 days by default; you can turn that off for each key. Some upstreams train on requests on paid plans too; Requesty may also train on free-plan requests. | `anthropic/claude-sonnet-5-5` | [app.requesty.ai](https://app.requesty.ai/api-keys), or `REQUESTY_API_KEY`; for the EU, set the **Address** to `https://router.eu.requesty.ai/v1` |
| TrustedRouter | A US gateway to models from many services, run on servers whose software can be checked independently. The gateway doesn't keep request content; each service behind it follows its own policy and may keep or train on requests. | `trustedrouter/auto` | [trustedrouter.com](https://trustedrouter.com), or `TRUSTEDROUTER_API_KEY` |
| Opper | A Swedish gateway to hundreds of models, built for keeping data in the EU. It doesn't store request content by default, but a model name without a route prefix may run outside the EU. | `claude-sonnet-5-5` | [platform.opper.ai](https://platform.opper.ai), or `OPPER_API_KEY` |
| Mistral | Mistral AI's own API, from France. Paid API requests aren't used for training by default; on a free account, turn training off under Privacy in the admin panel. Labs and Preview models may train regardless of that setting. | `mistral-small-2603` | [console.mistral.ai](https://console.mistral.ai/api-keys), or `MISTRAL_API_KEY`; for the EU, set **Address** to `https://api.eu.mistral.ai/v1` |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The guide row states that https://api.eu.mistral.ai/v1 is the EU address for Mistral. I can't check that from here (no network access). Please confirm it against Mistral's current API documentation before merge. If it isn't a documented regional endpoint, users who follow this row will get connection failures. The same claim is in the preset description in provider.rs, though that text only says the service is based in France.

Category: quality

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed against Mistral’s current regional inference documentation, which shows https://api.eu.mistral.ai/v1/chat/completions. The guide now links that source and notes supported-model limits and the 10% regional surcharge. This update is in be0e048; full fork CI passed.

@github-actions

Copy link
Copy Markdown
Contributor

Code review

Scope: Mistral added as an OpenAI-compatible preset, with call-ID remapping for Mistral's nine-character ID rule, typed-content parsing for streamed and whole replies, and matching CLI and docs updates. I reviewed the diff against the surrounding provider.rs code and the base-branch AGENTS.md. I could not build or run the tests (no shell in this review), so the Rust compile and test results are unverified.

Bugs

  • openai_content_text (provider.rs:1291) silently drops every non-text typed part from the reply and stream preview. AGENTS requires a notice for dropped data. Confidence: low-to-medium, since RustGIS sends only function tools and Mistral may not return these parts on this path.

Security

  • None found. The new code has no indexing or unwrap on hostile input. The message["content"] write is guarded by an is_array check, and mistral_call_ids uses get_mut. Confidence: high.

Performance

  • None significant. The per-event preview cost is linear in the parts of one chunk.

Quality

  • An empty leading {"type":"text","text":""} part can be stored when a stream opens with "" and an array arrives later, and it is replayed to Mistral (provider.rs:907). Whether Mistral rejects it is unverified. Confidence: medium.
  • The EU endpoint https://api.eu.mistral.ai/v1 in the guide (docs/user-guide/assistant.md:105) could not be checked offline. Confidence: that it needs verification is high; that it is wrong is unknown.
  • Correction to my inline note on that endpoint: the preset description in provider.rs does not contain the EU address. Only the guide does.
  • Nit: the ordering test near tests.rs:117 does not cover Mistral's position in the keyed-preset order.
  • Not raised: fragmented thinking chunks are stored as separate blocks, so replay fidelity is unverified. The PR body already discloses this.

AGENTS.md

  • No violations found. Checked:
    • no unwrap, expect or unsafe in the new non-test code;
    • provider lists are consistent in the CLI usage line, docs/cli.md, the guide's table, the browser CORS list and the README;
    • no other hardcoded provider lists exist (opper appears only in the expected places);
    • the preset strings follow the existing preset pattern;
    • no command surface, saved-file or schema change;
    • no platform-specific code, so no wasm concern.

Checked for twins: the other OpenAI-shaped read paths (non-streamed and streamed) and the stream preview, plus the Anthropic, Gemini and Responses parsers, which the diff does not touch. Tool-call ID remapping covers cross-provider calls because it runs on the outgoing message list.

Prior concerns: 0 review threads existed, so none were left alone.

Change size

Compared: the whole PR against main (merge base 9b0f0f9 to PR head 00c9c26).

Measure Value
Files changed 6 (0 added, 6 modified, 0 removed, 0 renamed)
Size before 532.9 KB
Size after 541.1 KB
Total size change +8.2 KB
Path Before After Change
crates/assistant/src/provider.rs 80.6 KB 84.6 KB +4.0 KB
crates/assistant/src/tests.rs 304.6 KB 308.3 KB +3.7 KB
docs/user-guide/assistant.md 35.1 KB 35.6 KB +486 B
docs/cli.md 13.8 KB 13.8 KB +11 B
README.md 27.8 KB 27.8 KB +9 B
apps/rustgis-cli/src/main.rs 71.0 KB 71.0 KB +8 B

}
}
let mut message = json!({"role": "assistant", "content": if content.is_empty() { Value::Null } else { json!(content) }});
if content.as_str() == Some("") {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check can no longer fire. The delta filter above never stores an empty string (v.as_str() != Some("")), and every push_str/append adds non-empty content, so content is never "". Meanwhile an all-empty array delta ("content": []) is stored as [], which the old code turned into null. A [] now goes into the native assistant message, and Mistral replays that native message on later turns. Normalising both empty shapes keeps the old behaviour and makes the check do its job:

Suggested change
if content.as_str() == Some("") {
if content.as_str() == Some("") || content.as_array().is_some_and(Vec::is_empty) {
content = Value::Null;
}

Confidence: high that the string branch is dead; medium that an empty array is a real replay problem (I can't test against the live API here).

Category: quality

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty-array normalization and removing the now-redundant string check are left for the release quality pass. The existing fix prevents empty string deltas from creating replay text blocks; no empty-array rejection has been demonstrated.

Turn::Assistant { native: Some((Api::OpenAi, m)), .. } => messages.push(m.clone()),
Turn::Assistant { native: Some((Api::OpenAi, m)), .. } => {
let mut message = m.clone();
// Mistral thinking/signature blocks are not valid assistant content for other

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For Mistral, this keeps the full native message, including every thinking block and its signature, and sends it back on each later request. Compaction does not reclaim that space. compact::trim (crates/assistant/src/compact.rs:157-167) strips thinking only for Api::Responses (reasoning) and Api::Anthropic (thinking, redacted_thinking). For Api::OpenAi it matches _ => &[], and it only edits native values that are arrays, while this one is an object. So Mistral thinking stays in every request for the rest of the conversation, and compact::size counts it toward the budget. That makes compaction trigger earlier and raises per-turn tokens for the whole session. Either drop the thinking parts from older OpenAI-shaped native turns in trim (the way the Anthropic branch does), or say in the PR why replay must keep them for all turns. Confidence: medium-high from reading the code; I have not measured the size.

Category: performance

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Full compaction does reclaim these blocks: compact::apply drains the summarized turns, including their native payloads. The earlier trimming pass does not strip OpenAI-shaped thinking, as noted. Adding that optimization, with provider replay validation, is left for the release quality pass; native reasoning is retained until the existing summary path replaces those turns.

@github-actions

Copy link
Copy Markdown
Contributor

Code review

Reviewed PR #3185 (Mistral provider). I read the full diff, the base-branch AGENTS.md, the prior threads, and the code around the changed lines (compact.rs, agent.rs, and the other readers in provider.rs). I found no crash, data-loss or wrong-result bug.

Bugs

  • None found. Notes are pushed only on a successful parse, and the Mistral and typed-reply tests cover both clean and lossy input. Confidence: medium-high.

Security

  • None significant. Low: the provider-supplied kind string goes into a transcript note without a length limit. It is bounded by the response size and only displayed, so this is a nit. Confidence: high that it's unbounded, low that it matters.

Performance

  • Mistral thinking blocks stay in the native replay and are sent on every later request. compact::trim only strips thinking for Responses and Anthropic, so the OpenAI-shaped native turn keeps it and compact::size counts it. Inline comment at provider.rs:1174. Confidence: medium-high (read from code, not measured).

Quality

  • The content == "" check at provider.rs:950 can never fire, and an all-empty [] delta is kept rather than normalised to null. Inline suggestion posted. Confidence: high (dead check); medium (empty-array replay problem).

AGENTS.md

  • Twin check, not a diff break: the Responses, Anthropic and Gemini readers still drop non-displayed parts without a notice, because notes: Vec::new() is set for each of them. That is a pre-existing silent loss under "Never silent", outside this PR's scope. Confidence: high that it's unnoticed; the rule is clear, so this is for the maintainer to decide whether it belongs in this PR.
  • Checked and fine: NOTE_TEMPLATES is updated; Note::with is used for the new notice; no command or schema changes, so the command-surface snapshot and schema don't need regenerating; no wasm-specific code is touched; no unwrap/expect is added outside tests; the CLI usage line, docs/cli.md, the assistant guide and the README were all updated for the new provider id; the web direct-call list in the guide is updated.

Earlier concerns left alone: 3.

  • The openai_content_text silent-drop thread is addressed by the new openai_content_notes and its tests.
  • The empty-text first-chunk suggestion at provider.rs:910 is still present and already raised, so I did not repeat it.
  • The EU endpoint thread is outdated and already raised.

Change size

Compared with the base branch (merge base 9b0f0f9 to PR head be0e048).

Measure Value
Files changed 7 (0 added, 7 modified, 0 removed, 0 renamed)
Size before 597.8 KB
Size after 609.9 KB
Total size change +12.1 KB
Path Before After Change
crates/assistant/src/tests.rs 304.6 KB 310.5 KB +5.9 KB
crates/assistant/src/provider.rs 80.6 KB 86.0 KB +5.4 KB
docs/user-guide/assistant.md 35.1 KB 35.7 KB +587 B
crates/assistant/src/agent.rs 64.9 KB 65.2 KB +224 B
docs/cli.md 13.8 KB 13.8 KB +11 B
README.md 27.8 KB 27.8 KB +9 B
apps/rustgis-cli/src/main.rs 71.0 KB 71.0 KB +8 B

@Mavrick-F

Copy link
Copy Markdown
Member Author

Bounding the provider-supplied content-kind label further is left for the release quality pass. Its current size remains bounded by the response limit.

@Mavrick-F
Mavrick-F added this pull request to the merge queue Nov 28, 2026
Merged via the queue into opengeos:main with commit f81b3b5 Nov 28, 2026
34 checks passed
@Mavrick-F
Mavrick-F deleted the feat/mistral-provider branch November 28, 2026 05:48
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