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
{{ message }}
Repository navigation
Mistral GLM relay models fail on tool calls (missing tool_call id in continuation chunks) #49692
Tool calls fail for every GLM model that Mistral relays (zai-glm-5, zai-glm-5-2, zai-glm-5-3, zai-glm-latest). The first tool call aborts:
✗ Read failed
Error: The read tool was called with invalid arguments:
SchemaError(Missing key at ["filePath"]).
Error: Type validation failed ...
"path": ["choices",0,"delta","tool_calls",0,"id"],
"message": "Invalid input: expected string, received undefined"
The pinned @ai-sdk/mistral (3.0.51) declares id: z.string() for every entry in a tool_calls delta. Mistral sends id and function.name only in the first delta for a given index; continuation chunks carry arguments fragments alone and are meant to be accumulated by index. So the continuation chunk fails validation, the arguments are never assembled, and the tool gets called with an empty object.
Mistral's own models are unaffected because they don't fragment tool-call arguments — the whole tool call arrives in one chunk with id set, so the continuation path is never taken.
@ai-sdk/mistral 3.0.59 fixed this upstream (schema relaxed to id: z.string().nullish(), deltas routed through StreamingToolCallTracker, which falls back to accumulating by index). Bumping the pin is enough; I opened #49689 for that.
Plugins
None.
OpenCode version
1.18.29
Steps to reproduce
opencode auth login with a Mistral API key
Add zai-glm-5-3 under the mistral provider in opencode.json
opencode run --model mistral/zai-glm-5-3 "read package.json and name the repo"
Activity
thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊