Mistral API does not accept `reasoning_content` field
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start by tracing how the Mistral provider builds assistant messages for the next request, especially messages containing reasoning from the previous response. The issue reports a 422 because reasoning_content is sent as an extra field and suggests Mistral's thinking content format as a possible direction. Done means a follow-up prompt works after a reasoning response.
由索引模型根据 Issue 内容生成。
描述
To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.
Please avoid AI slops, be concise, and focus on what matters for this issue.
Describe the bug
When working with models provided via Mistral's API that support thinking/reasoning (GLM 5.3, Mistral Large 4, etc) and reasoning is enabled (e.g. reasoning_effort: high), the second prompt send by the user always fails with response status code 422 and message and an error message of the sort:
{"detail":[{"type":"extra_forbidden","loc":["body","messages",2,"assistant","reasoning_content"],"msg":"Extra inputs are not permitted","input":"The user just said \"Hello.\" with no specific task. I should respond briefly and greet them, maybe noting what I can see in their workspace. No need for tools here. Keep it short."}]}
To Reproduce
Steps to reproduce the behavior:
- Select a model hosted by Mistral that supports reasoning (e.g.
mistral/zai-glm-5-3). - Write and send a simple user prompt (e.g. "Hello")
- Wait the model to think and reply (the reply must include a "thought" block).
- Write and send another user prompt (e.g. "Hi again").
Expected behavior
Receive a proper response from the model and resume the conversation.
Doctor
ECA version: 0.166.0
Server cmd: ~/.cache/emacs/eca/eca server
Logged providers:
mistral: API key (XXX**********XXX)
Screenshots
Additional context
I have encountered the same issue with other frameworks and the problem there was caused by Mistral's API not expecting a reasoning_content field, like Deepseek's and OpenAI's APIs. Not sure if that is the proper solution or just a workaround but, it appears that placing reasoning content inside a "thinking" element (seems unique to Mistral's API spec) which is placed inside the content of a regular "assistant" message, works. For example:
{
"model": "mistral-small-latest",
"messages": [
{
"role": "system",
"content": "You are a large language model living in Emacs and a helpful assistant. Respond concisely."
},
{
"role": "user",
"content": "Hello. Please list the files in the current directory and report them to me."
},
{
"role": "assistant",
"tool_calls": [
{
"id": "oagouVY1Z",
"type": "function",
"function": {
"name": "list_directory",
"arguments": "{\"path\": \".\"}"
},
"index": 0
}
],
"content": [
{
"type": "thinking",
"thinking": [
{
"type": "text",
"text": "The user wants me to list the files in the current directory. I need to use the list_directory tool to do this. Since they said \"current directory\", I should use \".\" as the path to represent the current directory."
}
],
"closed": true
}
]
},
{
"role": "tool",
"tool_call_id": "oagouVY1Z",
"content": "..."
}
],
"stream": false,
"tools": [
{
"type": "function",
"function": {
"name": "list_directory",
"description": "List the contents of a specified directory.",
"parameters": {
"type": "object",
"properties": {
"path": {
"description": "Path to the directory. Supports relative paths and '~'.",
"type": "string"
}
},
"required": [
"path"
],
"additionalProperties": false
}
}
}
],
"parallel_tool_calls": true,
"reasoning_effort": "high"
}
- 主要语言
- Clojure
- 星标
- 1k
- 派生
- 82
- 平均合并
- 2 天 10 分钟
- 30 天内合并 PR
- 19
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
editor-code-assistant/eca 的其他 Issue
-
Built-in web search is disabled for newer OpenAI models可能已有人在做 @stamdrovas 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
editor-code-assistant/eca#677 ·
维护者通常 2 天内回复
-
Models doesn't work when fetchModels: false is used可能已有人在做 @zikajk 于 8 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
editor-code-assistant/eca#661 · 已指派 1 人 ·
维护者通常 2 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 74/100
editor-code-assistant/eca#672 ·
维护者通常 2 天内回复
-
难度 3/5 1-2 天 新手友好度 45/100
editor-code-assistant/eca#671 · 2 条评论 ·
维护者通常 2 天内回复
-
难度 4/5 3-5 天 新手友好度 25/100
editor-code-assistant/eca#670 ·
维护者通常 2 天内回复
查看 editor-code-assistant/eca 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
clojure-emacs/cider#4224 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
-
.Needs Triage Priority:P3 Type:Bug
难度 2/5 1-3 小时 新手友好度 62/100
metabase/metabase#85686 · 1 条评论 ·
维护者通常 1 天内回复
-
bug triage
难度 2/5 1-3 小时 新手友好度 70/100
defold/defold#13578 · 1 个 reaction ·
维护者通常 1 天内回复
-
bug: Editing the L value in HSL mode resets H and S to 0可能已有人在做 @makesomethingshit 于 3 天前认领。 未关闭good first issue WG adoption
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复