mistral: Add Z.ai GLM (latest version) and show thinking toggle for supported models (#63535)
# Objective
- Add Z.ai GLM, now hosted by Mistral as a third-party open model, to
the
built-in Mistral model list.
- Fix the thinking selector never appearing for Mistral models that
support
reasoning (mistral-medium-latest, mistral-small-latest).
## Solution
- Added a `ZaiGlmLatest` variant to `mistral::Model` that uses Mistral's
`zai-glm-latest` model id: 1M token context window, tool calling
enabled,
image input disabled, thinking enabled. The provider builds its model
list
by iterating this enum, so no further wiring was needed.
- This PR initially targeted GLM 5.2 (`zai-glm-5-2`), but Mistral
released
5.3 while it was open. Switching to the `zai-glm-latest` alias keeps Zed
on
the newest GLM release without requiring a new PR each time Mistral
bumps
the version, mirroring how Mistral's own model ids work for their
flagship
models.
- Implemented the missing `LanguageModel::supports_thinking()` override
in the
Mistral provider, delegating to `mistral::Model::supports_thinking()`.
The
request-building code already sent `reasoning_effort` and serialized
thinking
parts, but the UI toggle was hidden because the trait method fell back
to the
default `false`.
## Testing
- `./script/clippy -p mistral` and `cargo check -p language_models`
pass.
- Existing unit tests in the provider cover the `reasoning_effort`
request
mapping; no new behavior beyond the enum variant and the trait
delegation.
- Reviewers can test with a Mistral API key: `zai-glm-latest` appears in
the
model dropdown, and the thinking toggle now shows for zai-glm-latest,
mistral-medium-latest, and mistral-small-latest.
- Tested on macOS; changes are platform-independent.
## Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
---
Release Notes:
- Added Z.ai GLM to the Mistral provider and fixed the thinking toggle
for Mistral Small and Medium.
---------
Co-authored-by: dino <dinojoaocosta@gmail.com>
a4b9dc5f52ummon-v committed on 9/22/2026, 11:01:26 AM· committed by GitHubparent02238cd