Mistral API does not accept `reasoning_content` field
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 54/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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"
}
- Lenguaje dominante
- Clojure
- Estrellas
- 1k
- Forks
- 82
- Merge medio
- 2 d 2 h
- PR fusionados (30 d)
- 21
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de editor-code-assistant/eca
-
Models doesn't work when fetchModels: false is usedPosiblemente ocupada @zikajk la tomó hace 9 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
editor-code-assistant/eca#661 · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 74/100
editor-code-assistant/eca#672 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
editor-code-assistant/eca#671 · 2 comentarios ·
Los mantenedores suelen responder en 2 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
editor-code-assistant/eca#670 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
editor-code-assistant/eca#669 ·
Los mantenedores suelen responder en 2 días
Todos los issues de editor-code-assistant/eca
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
module:rest-api
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
WG adoption
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 4 días