Skip to content

[Bug]: Extra inputs are not permitted for reasonning_content field in Mistral Provider #30835

Description

@hgsmn

Check for existing issues

  • I have searched the existing issues and checked that my issue is not a duplicate.

What happened?

Bug: reasoning_content in input assistant messages causes 422 Unprocessable Entity

Summary

When an assistant message in the request payload includes a reasoning_content
field, the upstream Mistral backend rejects the whole request with a
422 Unprocessable Entity (extra_forbidden). The field is a model output
and is not permitted as input, but it is currently being forwarded as-is.

Environment

  • Model: mistral-medium-3-5
  • Backend: LiteLLM proxy → Mistral
  • Endpoint: POST /api/chat/completions

Root cause (suspected)

Assistant messages are stored and replayed verbatim, including the
reasoning_content field returned by a previous completion. Mistral's input
schema forbids extra fields, so the replayed field triggers extra_forbidden.

Steps to Reproduce

Send a chat completion request where one of the assistant messages carries a
reasoning_content key:

curl -v -X POST "https://<host>/api/chat/completions" \
  -H "Content-Type: application/json; charset=utf-8" \
  -H "Authorization: Bearer <token>" \
  --data-binary @payload.json

payload.json:

{
  "model": "mistral-medium-3-5",
  "messages": [
    { "role": "user", "content": "Question?" },
    { "role": "assistant", "content": "Analysis in progress..." },
    {
      "role": "assistant",
      "content": "Follow-up",
      "reasoning_content": "Some internal reasoning text."
    }
  ],
  "temperature": 1.0
}

Actual result

{
  "error": {
    "message": "litellm.BadRequestError: MistralException - {\"detail\":[{\"type\":\"extra_forbidden\",\"loc\":[\"body\",\"messages\",2,\"assistant\",\"reasoning_content\"],\"msg\":\"Extra inputs are not permitted\",\"input\":\"...\"}]}",
    "type": null,
    "param": null,
    "code": "422"
  }
}

Relevant log output

What part of LiteLLM is this about?

Proxy

What LiteLLM version are you on ?

v1.87.3

Twitter / LinkedIn details

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions