Repository navigation
Description
Client or integration
OpenCode 2.2.6 (desktop/TUI and opencode run), connected as an OpenAI-compatible provider using the model blocks from Connect > API Keys (OpenCode tab), against a self-hosted OpenCodex 2.99.0 hub.
Provider or upstream service
Mistral routes with dashboard-issued custom model IDs (deepseek-v4-1-flash-1017, zai-glm-5-3, zai-glm-5-3-flash, all mistral/*), forwarded to api.mistral.ai (Mistral API key). Mistral's strict Chat schema per #8278.
OpenCodex version
2.99.0
Endpoint or capability
/v1/chat/completions — Chat Completions ingress, native Chat-to-Chat passthrough, reasoning_content in assistant message history.
Current behaviour
The first request of a conversation succeeds (post the #8251 reasoning-levels fix). Every follow-up request whose message history contains an assistant message carrying reasoning_content is rejected with HTTP 422 and the generic client message The provider rejected the request. Repeating or resuming the conversation keeps failing, so every multi-turn or tool-loop session on Mistral routes dies on the second request and cannot be resumed on that provider.
Client-side note: OpenCode replays reasoning_content unconditionally for openai-compatible reasoning models. Neither removing compatibility.reasoningField nor capabilities.reasoning.supported: false disables the replay, so there is no client workaround.
Control: the identical payload with the reasoning_content field removed from the assistant message returns HTTP 200. The same client shape (assistant tool_calls + tool result replay, no reasoning field) succeeds on other hub routes.
Expected behaviour
For Mistral-destination Chat Completions requests, strip per-message reasoning fields (reasoning_content, reasoning) from assistant messages before forwarding — the per-message counterpart of the #8278 top-level Mistral wire policy. Given #7140 already adds per-destination restore logic for upstreams that require replay, this is the strip counterpart for upstreams that reject it. The policy should also apply to custom-named Mistral model IDs created from the dashboard export (cf. #4632, custom-named entries not inheriting compatibility metadata). Alternatively, a clear "unsupported combination" error instead of a generic 422.
Minimal redacted request or reproduction
Against a 2.99.0 hub, model mistral/deepseek-v4-1-flash-1017, max_tokens: 24:
Fails (422):
{"model":"mistral/deepseek-v4-1-flash-1017","max_tokens":24,"messages":[
{"role":"user","content":"hi"},
{"role":"assistant","content":"Hello.","reasoning_content":"greeting"},
{"role":"user","content":"and goodbye"}
]}Passes (200) — same payload minus reasoning_content:
{"model":"mistral/deepseek-v4-1-flash-1017","max_tokens":24,"messages":[
{"role":"user","content":"hi"},
{"role":"assistant","content":"Hello."},
{"role":"user","content":"and goodbye"}
]}Also 200: assistant history with tool_calls + tool result and no reasoning fields. Also 422: assistant message with reasoning_content alongside tool_calls. Reproduced 2026-11-09T03:09Z on 2.99.0.
Actual response or error
HTTP 422
{"error":{"message":"The provider rejected the request.","type":"invalid_request_error","param":null,"code":"invalid_request_error"}}
The generic wrapper hides the upstream detail, so the client cannot tell which field caused the rejection.
Additional context
- Follow-up to Native Chat passthrough relays Mistral typed content arrays, breaking OpenAI-compatible clients #8251 / fix(mistral): sanitize Chat fields and normalize native thinking content #8278: the merged top-level wire policy fixed turn-1 rejections (effort levels,
max_completion_tokens,user,store...), but per-message reasoning fields on the Chat ingress are still forwarded verbatim. - fix(chat): restore DeepSeek reasoning on native tool continuations (#7118) #7140 (restore path for DeepSeek) indicates the native Chat lane forwards supplied history unchanged per destination; Mistral needs the opposite direction.
- Every OpenCode/other OpenAI-compat client that preserves interleaved reasoning for R1-style models hits this on second turn. Models also emit
reasoning_contenton these routes, so clients replay it per the community convention.
Activity
github-actions commentedon Nov 9, 2026
Issue closed: insufficient detail
Thanks for taking the time to submit this issue. It was closed automatically because the structured report is missing information needed to evaluate or reproduce it.
Please edit the issue to add:
See the Contributing guide for details.
Once the report passes the automated checks, it will be reopened automatically unless a maintainer has changed its state.
fix(chat): strip replayed reasoning_content from message history for …
fix(chat): strip replayed reasoning_content from message history for …
lidge-jun commentedon Nov 11, 2026
The defect described here is fixed on
devby #8432 (merge commit 8b1dcb3). Canonical key-auth Mistral Chat now drops replayedreasoning_contentfrom message history on both the native and translated paths, and native reasoning replay can no longer restore it. This issue was closed by automation before that landed; this note records the fix.