-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Request fails with 422: max_completion_tokens not permitted when using Mistral provider #7762
Description
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
- Configure Goose to use a Mistral provider/model
- Start a Goose session (
goose) - Send any message (e.g.
hello) - 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.