Repository navigation
[Bug] Mistral Large 4 reasoning uses unsupported prompt_mode instead of reasoning_effort #3584
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.
Uh oh!
There was an error while loading. Please reload this page.
Bug
Prime Agent 0.10.0 sends
prompt_mode: "reasoning"for Mistral Large 4 when thinking is enabled. Mistral rejects the request with HTTP 400, code 3051:Reproduction
Register
mistral-large-4under themistralprovider with APImistral-conversations,reasoning: true, and a High-onlythinkingLevelMap. Start a turn with--provider mistral --model mistral-large-4 --thinking high.The native simple-stream adapter selects the prompt-mode path because
uses_reasoning_effort()recognizes only three older small/medium model IDs.Expected request control:
{"reasoning_effort": "high"}Actual request control:
{"prompt_mode": "reasoning"}Evidence and proposed fix
reasoning_effort.POST /v1/chat/completionswithmodel: "mistral-large-4"andreasoning_effort: "high"returned HTTP 200 and structured thinking. No credentials or private prompts are included here.mistral-large-4,mistral-large-4-0, andmistral-large-4-unrestrictedto the existinguses_reasoning_effort()predicate. The existing payload conversion and effort mapping already supporthigh.thinkingLevelMap; no UI changes are needed.Prepared patch: devteapot@8a888fce7
The regression test calls
stream_simple_mistral()against an isolated local HTTP server and compares the complete JSON request for each of the three IDs. It fails before the fix with the actualprompt_modebody and passes after the fix withreasoning_effort: "high"and no prompt mode.Validation
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. Full workspace gates have not been run.Scope and parity
This is a private adapter behavior change owned by
pa-ai, consistent with its provider/streaming scope. No new dependencies, public API, cross-crate exports, catalog data, or UI changes. GLM routing is out of scope.Source inspection of the v0.9.8 TypeScript reference shows the same three-ID restriction, so this is a correction to shared older behavior rather than claimed wire parity with that release. A full TS-binary wire comparison has not been run.
I read CONTRIBUTING.md and am posting this 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