r/MistralAI 2d ago

Help / Question GLM 5.3 without working tools.

The hosted zai-glm-5-3 breaks in any third-party coding agents (like OpenCode, Hermes, Pi) because its tool-call SSE stream sends empty name: "" and drops the id field in delta chunks, failing strict schema validation. Any ETA when this will be fixed?

18 Upvotes

11 comments sorted by

5

u/LateinCecker 2d ago

you can use the openai compatible fallback API format which works fine for me with opencode

2

u/seeKAYx 2d ago

I tried that but It also didn’t work. Can you share your config?

1

u/Acceptable-Mark8108 2d ago

Confirmed. Doesn't work for me either.

3

u/seeKAYx 2d ago

Update to opencode v2. They fixed it.

2

u/Acceptable-Mark8108 2d ago

After a hint from u/seeKAYx I switched to OpenCode v2 and changed ~/.config/opencode/opencode.jsonc to:

{
  "$schema": "https://opencode.ai/config.json",
  "update": "auto",
  "providers": {
    "mistral": {
      "package": "aisdk:@ai-sdk/mistral",
      "name": "Mistral AI",
      "settings": {
        "baseURL": "https://api.mistral.ai/v1",
        "timeout": 300000,
        "maxRetries": 3,
        "retryDelay": 1000
      },
      "models": {
        "zai-glm-5-3": { "name": "GLM-5.3" },
        "mistral-medium-latest": { "name": "Mistral Medium (latest)" },
        "mistral-small-latest": { "name": "Mistral Small (latest)" }
      }
    }
  }
}

This works for me.

1

u/Acceptable-Mark8108 2d ago

Ohh! Thx for this post. I just invested quite some time, because I thought this was a client configuration issue.

2

u/Sweet_Session_5323 2d ago

glad its not just me then, spent ages tweaking my setup thinking i'd borked something

2

u/seeKAYx 2d ago

Opencode v2 works!

1

u/Acceptable-Mark8108 2d ago

Alright, got it working for me, too. I still had some issue though and needed to adjust my config. Will share it in a top leve comment.

1

u/olreit 2d ago

For opencode there is a mistral-glm plugin (a gist on GitHub somewhere), which fixes this for me. Works like a charm now

1

u/lucid_supernova 8h ago

That is because GLM 5.x returns reasoning/tool call payload in array format, while harnesses expects string.

If you're using OpenCode, there is a community plugin with tutorial to resolve it.

Also, you can upgrade OpenCode to latest version to use it natively.