Repository navigation
[Bug] Mistral-served GLM 5.3 uses prompt_mode and loses Low/Max reasoning efforts #3585
devteapot
started this conversation in
Bug reports
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Bug
Prime Agent 0.10.0 cannot send the supported Low and Max reasoning efforts for GLM 5.3 served by Mistral.
The Mistral native adapter has two problems:
uses_reasoning_effort()does not recognize the GLM 5.3 IDs, so enabling thinking sendsprompt_mode: "reasoning"instead ofreasoning_effort.noneandhigh. Adding a GLM ID to the routing predicate alone would still collapselowandmaxtohigh.Mistral's reasoning documentation explicitly says
zai-glm-5-3supportslow,high, andmax, notnone.Reproduction
Register
zai-glm-5-3under providermistral, APImistral-conversations, withreasoning: trueand this map:{ "thinkingLevelMap": { "off": null, "minimal": null, "low": "low", "medium": null, "high": "high", "xhigh": null, "max": "max" } }Run a turn with
--provider mistral --model zai-glm-5-3 --thinking low, or select High or Max.Expected: the selected
reasoning_effortis sent unchanged, with noprompt_mode. Before the patch the captured native HTTP request containsprompt_mode: "reasoning"for Low.Proposed fix
Prepared patch: devteapot@25d47209d
zai-glm-5-3,zai-glm-5, andzai-glm-latestthroughreasoning_effort.lowandmax.thinkingLevelMap; no UI special case or catalog edits.The native HTTP regression covers all three IDs and all three efforts, comparing the complete request JSON. It fails before the patch with
prompt_modeand passes after it. Additional mapping checks cover GLM's Low/Max values and the older Mistral default behavior.Validation
stream_simple_mistral()and an isolated loopback HTTP server.cargo fmt --all --checkpasses.cargo clippy --locked -p pa-ai --all-targets -- -D warningspasses.cargo test --locked -p pa-ai --libpasses: 327 passed, 3 ignored.Scope and parity
This is an internal
pa-aiprovider-adapter change, consistent with the crate's scope and dependency direction. The effort enum is inside the private provider module; there is no new exported API, dependency, cross-crate export, UI change, or catalog change.The v0.9.8 TypeScript reference has the same older model-ID restriction and none/high effort mapping. This patch corrects that shared older behavior. A full TS-binary wire comparison has not been run; no parity claim is made.
This branch is based directly on upstream main and does not include the separate ML4 patch in #3584. #3429 concerns GLM on the
zaiprovider during compaction; this report concerns GLM served by themistralprovider and native effort serialization.I read CONTRIBUTING.md and am posting this separate Discussion rather than an unsolicited PR. Would a maintainer invite a focused PR for this patch? I prepared the change with agent assistance and reviewed it locally.
All reactions