You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using codestral, pixtral, or mixtral via a custom @ai-sdk/openai-compatible endpoint, tool call IDs are not normalized to Mistral's required 9-character alphanumeric format, causing API errors. PR #2440 added this for @ai-sdk/mistral and devstral but missed these three.
Plugins
none
OpenCode version
v1.2.21, dev
Steps to reproduce
Configure a custom provider in opencode.json using @ai-sdk/openai-compatible with a model ID containing codestral, pixtral, or mixtral
Start a session and trigger a tool call
Observe API error due to invalid tool call ID format
Using Mistral Medium 3.5, does the tool calls work for you ? Mine is corrupted and it can't properly call basic tools.
OpenCode: 1.14.40
Model: mistral/mistral-medium-2604
Provider: native mistral via @ai-sdk/mistral
Runtime where bug appears: OpenCode worker / harness session
Plugins enabled: @tarquinen/opencode-dcp@latest
Platform: macOS arm64
Observed examples:
write{"filePath":"...","content":"..."}
task{"description":"...","prompt":"..."}
read{"filePath":"..."}
Those are rendered as normal assistant text/final content, so no tool executes. Session becomes unusable because the agent keeps “calling” tools in plain text.
I also ran into the same issue as @fmflurry. It happens very frequently to me. It simply responds the toolcall in a normal user message and then gets stuck, as the toolcall does not come back.
I also ran into the same issue as @fmflurry. It happens very frequently to me. It simply responds the toolcall in a normal user message and then gets stuck, as the toolcall does not come back.
I found a solution. I updated the @ai-sdk/mistral and created a provider to override the default one.
Activity
[-][BUG]: codestral, pixtral, mixtral skip Mistral tool call transform (follow-up)[/-][+][BUG]: codestral, pixtral, mixtral skip Mistral tool call transform (has fix)[/+]fmflurry commentedon May 7, 2026
Using Mistral Medium 3.5, does the tool calls work for you ? Mine is corrupted and it can't properly call basic tools.
Observed examples:
write{"filePath":"...","content":"..."}
task{"description":"...","prompt":"..."}
read{"filePath":"..."}
Those are rendered as normal assistant text/final content, so no tool executes. Session becomes unusable because the agent keeps “calling” tools in plain text.
sttomm commentedon May 13, 2026
I also ran into the same issue as @fmflurry. It happens very frequently to me. It simply responds the toolcall in a normal user message and then gets stuck, as the toolcall does not come back.
fmflurry commentedon May 13, 2026
I found a solution. I updated the @ai-sdk/mistral and created a provider to override the default one.
Crazyphil commentedon Jul 6, 2026
@fmflurry How did you define the provider? I tried the same workaround, but I still get the same bug.
This is my definition in
openhab.jsonc:{ // ... "provider": { "mistral": { "name": "Mistral (custom)", "npm": "@ai-sdk/mistral@4.0.5", "models": { "mistral-medium-3-5": { "name": "Mistral Medium 3.5", "variants": { "high": { "reasoningEffort": "high" } } }, "mistral-small-2603": { "name": "Mistral Small 4", "variants": { "high": { "reasoningEffort": "high" } } } } } }, // ... }fmflurry commentedon Jul 6, 2026
Take a look at the bottom of my config file : https://github.com/fmflurry/settings-opencode/blob/master/opencode.jsonc