Skip to content

Request fails with 422: max_completion_tokens not permitted when using Mistral provider #7762

@Jank1310

Description

@Jank1310

Describe the bug

When using Goose with a Mistral provider, sending any message results in a 422 Unprocessable Entity error. The Mistral API rejects the max_completion_tokens parameter, which Goose appears to send by default but is not supported by Mistral's API.

Error message:

Request failed: Request failed with status 422 Unprocessable Entity: {"object":"error","message":{"detail":[{"type":"extra_forbidden","loc":["body","max_completion_tokens"],"msg":"Extra inputs are not permitted","input":16384}]},"type":"invalid_request_error","param":null,"code":null}

To Reproduce

  1. Configure Goose to use a Mistral provider/model
  2. Start a Goose session (goose)
  3. Send any message (e.g. hello)
  4. See the 422 error

Expected behavior

Goose should either omit unsupported parameters like max_completion_tokens when calling the Mistral API, or map them to Mistral-compatible equivalents (e.g. max_tokens).


Screenshots

N/A


Please provide the following information

  • OS & Arch: macOS (Apple Silicon)
  • Interface: CLI & App
  • Version: 1.27.2
  • Extensions enabled: default
  • Provider & Model: Mistral

Additional context

Mistral's API does not accept max_completion_tokens as a valid parameter. It appears Goose is sending this OpenAI-style parameter without filtering it for Mistral compatibility. The input value of 16384 in the error suggests this is a hardcoded default.

Metadata

Metadata

Assignees

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