Skip to content

[Bug]: mistral - invalid_request_message_order #17761

@towry

Description

@towry

What happened?

19:59:12 - LiteLLM Router:INFO: router.py:3059 - ageneric_api_call_with_fallbacks(model=mistral/devstral-2512) 200 OK
INFO:     127.0.0.1:54768 - "POST /v1/messages?beta=true HTTP/1.1" 200 OK
INFO:     127.0.0.1:54828 - "GET /metrics HTTP/1.1" 404 Not Found
19:59:13 - LiteLLM Router:INFO: router.py:3065 - ageneric_api_call_with_fallbacks(model=mistral/devstral-2512) Exception litellm.BadRequestError: MistralException - {"object":"error","message":"Unexpected role 'user' after role 'tool'","type":"invalid_request_message_order","param":null,"code":"3230"}
19:59:15 - LiteLLM Router:INFO: router.py:3065 - ageneric_api_call_with_fallbacks(model=mistral/devstral-2512) Exception litellm.BadRequestError: MistralException - {"object":"error","message":"Unexpected role 'user' after role 'tool'","type":"invalid_request_message_order","param":null,"code":"3230"}
19:59:17 - LiteLLM Router:INFO: router.py:3065 - ageneric_api_call_with_fallbacks(model=mistral/devstral-2512) Exception litellm.BadRequestError: MistralException - {"object":"error","message":"Unexpected role 'user' after role 'tool'","type":"invalid_request_message_order","param":null,"code":"3230"}

Relevant log output

zed-industries/zed#32675

This issue happens when using the claude with skill.

> good, now load git-jj skill.

⏺ Skill(git-jj)

Are you a ML Ops Team?

No

What LiteLLM version are you on ?

v1.80.9

Twitter / LinkedIn details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions