Skip to content

HTTP code 400 when using Mistral AI as the provider #5998

@ErwanLegrand

Description

@ErwanLegrand

Describe the bug
When a tool is used with a Mistral LLM, the following error is encountered:
Ran into this error: Request failed: Bad request (400): Unexpected role 'user' after role 'tool'.
This is a common error everyone encounters when implementing support for Mistral AI after OpenAI support is already implemented.
The fix is simple: there must be another request between the tool request and the next user request.


To Reproduce
Steps to reproduce the behavior:

  1. Configure Mistra AI as the provider
  2. Start a goose session
  3. Make the agent use a tool
  4. Send another message to the agent

Expected behavior
No HTTP error. Agent responds.


Screenshots
If applicable, add screenshots to help explain your problem.


Please provide the following information

  • OS & Arch: Debian AMD64
  • Interface: CLI
  • Version: [e.g. v1.0.2]
  • Extensions enabled: [e.g. Computer Controller, Figma]
  • Provider & Model: [e.g. Google – gemini-1.5-pro]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions