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
I receive the same error message when using the Chutes provider with the GLM 4.5 Air Model. Using the Qwen3 Model via Chutes does work, so it seems to be tied to the GLM models
Yes exactly i also receive that error via chutes api . Its the GLM models response format i guess. @thdxr Kindly assist to accommodate GLM models better .
I can reproduce this error on v0.5.5 version of Opencode. What I found is that if you use Chutes AI as a provider and choose GLM 4.5 FP8 model, every time when the model create the todo list by calling this tool it shows the above error. Occasionally, when this model called the read file tool it also showed the above. I tried the same model with same provider on Kilo code to check if it is provider's issue but seems it worked fine on that.
I'll subscribe to this issue too, as running unsloth's GLM-4.5-Air-UD-Q4_K_XL, served by llama.cpp, using opencode has been a challenge and I'm out of ideas. My opencode.json contains:
I've done some experimentation with removing some of the options or mixing which options to use, but I haven't yet found a magic combination. The read tools seem to be working but trying to use any tools that write files just fails with errors.
The same model served from the same server works 100% in Cline/VSCode, but I'm really looking for a good terminal based coder that works with GLM 4.5, since it's the best model I can run on my local setup. I did try gpt-oss:20b/ollama and it worked with opencode. I assume 120b would also work. I do have qwen3-coder:30b-a3b, which also works nicely with Cline, it's just not as strong as GLM 4.5 air.
Hopefully someone can point me to a working config for opencode, or recommend another capable terminal coder that will work with GLM-4.5, I'm not particularly tied to opencoder since I've never been able to get it to work correctly.
Thank you all, in advance, for your help.
Reacted by Abdiazizahmedali, Christer and Chindriș Mihai - Alexandru
I was even get it to call some tools, write some files but it's about is flaky as they come. Still looking for some guidance from anyone has this setup working. I'm tied to opencode, but I'd be willing to give any competent terminal coder a try. For now, I'll just be happy that Cline seems to work pretty well.
I wonder if there can be a special case to handle this error message and treat it like a failed tool call (it was going to fail anyway), prompting the LLM to try again.
@aaronnewsome you probably want to watch this thread; I've run this branch of llama.cpp locally and tool calling is much better (flawless?) there.
Any inference providers using llama.cpp in production will also benefit from this patch; hard to say if that's going to affect z.ai as well. They may be using vLLM.
Reacted by aaronnewsome and Chindriș Mihai - Alexandru
Thanks for the tip @jdiaz5513 , I pulled the latest b6517, applied the pr 15904 and built it. I'm running llama.cpp with the chat template in the PR and opencode is working much, much better. It was working somewhat with the chat template in comments on the GLM-4.5-Air huggingface page, tool calls would succeed but then the chat would just stop instead of continuing to the next step. Super annoying to keep typing "proceed" or "continue" after each and every tool call. Talk about a productivity killer. I'm not seeing the issue any longer with PR 15904. Hopefully the PR gets merged soon, so it's in the main. Again, thank you for the tip.
I just had this AI_InvalidResponseDataError: Expected 'id' to be a string error repeatedly from Big Pickle (GLM 4.6) when it tried to edit, and finally I realised I had it in Plan mode...
For me, it just works now with GLM-4.7 after updating to the latest vLLM nightly. I think there was a bug in vLLM which was fixed. It also works through LiteLLM.
For other people having the same problem, you can use mitmproxy to see the exact tool calls in the HTTP responses . First, start mitmweb (part of mitmproxy). Then, before starting opencode, set the following variables:
Now, try one time the problematic API of the LLM and one time a proper working version (e.g. GLM-4.7 OpenCode Zen) with a simple prompt. You can then compare the HTTP response to the same prompt e.g. with Gemini. With this information, you can the easier report the problem e.g. to the inference engine or the API provider.
Activity
legout commentedon Aug 13, 2025
Same error here
beyondpixeldesign commentedon Aug 13, 2025
I receive the same error message when using the Chutes provider with the GLM 4.5 Air Model. Using the Qwen3 Model via Chutes does work, so it seems to be tied to the GLM models
Abdiazizahmedali commentedon Aug 13, 2025
Yes exactly i also receive that error via chutes api . Its the GLM models response format i guess. @thdxr Kindly assist to accommodate GLM models better .
Yesseuki commentedon Aug 14, 2025
Seeing the same with openrouter and standard GLM 4.5 model.
theoriginalaiexplorer commentedon Aug 15, 2025
From My experience if you try to jailbreak it asking something it has been asked to not to do. I see this issue.
cgycorey commentedon Aug 17, 2025
I can reproduce this error on v0.5.5 version of Opencode. What I found is that if you use Chutes AI as a provider and choose GLM 4.5 FP8 model, every time when the model create the todo list by calling this tool it shows the above error. Occasionally, when this model called the read file tool it also showed the above. I tried the same model with same provider on Kilo code to check if it is provider's issue but seems it worked fine on that.
stickyburn commentedon Aug 27, 2025
Facing the same for days now. I think it might be on the model?
aaronnewsome commentedon Sep 2, 2025
I'll subscribe to this issue too, as running unsloth's GLM-4.5-Air-UD-Q4_K_XL, served by llama.cpp, using opencode has been a challenge and I'm out of ideas. My opencode.json contains:
I've done some experimentation with removing some of the options or mixing which options to use, but I haven't yet found a magic combination. The read tools seem to be working but trying to use any tools that write files just fails with errors.
The same model served from the same server works 100% in Cline/VSCode, but I'm really looking for a good terminal based coder that works with GLM 4.5, since it's the best model I can run on my local setup. I did try gpt-oss:20b/ollama and it worked with opencode. I assume 120b would also work. I do have qwen3-coder:30b-a3b, which also works nicely with Cline, it's just not as strong as GLM 4.5 air.
Hopefully someone can point me to a working config for opencode, or recommend another capable terminal coder that will work with GLM-4.5, I'm not particularly tied to opencoder since I've never been able to get it to work correctly.
Thank you all, in advance, for your help.
xypur commentedon Sep 11, 2025
This issue still exists
aaronnewsome commentedon Sep 11, 2025
I was able to get opencode talking to my GLM-4.5-AIR, served by llama.cpp with this chat template
https://huggingface.co/unsloth/GLM-4.5-Air-GGUF/discussions/1
I was even get it to call some tools, write some files but it's about is flaky as they come. Still looking for some guidance from anyone has this setup working. I'm tied to opencode, but I'd be willing to give any competent terminal coder a try. For now, I'll just be happy that Cline seems to work pretty well.
jdiaz5513 commentedon Sep 17, 2025
This happens when the model hallucinates the tool name and the chat template (on the inference server, like at z.ai) fails to parse it.
See: #2557 (comment)
I wonder if there can be a special case to handle this error message and treat it like a failed tool call (it was going to fail anyway), prompting the LLM to try again.
jdiaz5513 commentedon Sep 19, 2025
@aaronnewsome you probably want to watch this thread; I've run this branch of llama.cpp locally and tool calling is much better (flawless?) there.
Any inference providers using llama.cpp in production will also benefit from this patch; hard to say if that's going to affect z.ai as well. They may be using vLLM.
aaronnewsome commentedon Sep 19, 2025
Thanks for the tip @jdiaz5513 , I pulled the latest b6517, applied the pr 15904 and built it. I'm running llama.cpp with the chat template in the PR and opencode is working much, much better. It was working somewhat with the chat template in comments on the GLM-4.5-Air huggingface page, tool calls would succeed but then the chat would just stop instead of continuing to the next step. Super annoying to keep typing "proceed" or "continue" after each and every tool call. Talk about a productivity killer. I'm not seeing the issue any longer with PR 15904. Hopefully the PR gets merged soon, so it's in the main. Again, thank you for the tip.
rversteegen commentedon Nov 1, 2025
I just had this
AI_InvalidResponseDataError: Expected 'id' to be a stringerror repeatedly from Big Pickle (GLM 4.6) when it tried to edit, and finally I realised I had it in Plan mode...vinicius507 commentedon Nov 12, 2025
Ununnilium commentedon Jan 5, 2026
I have the error with GLM-4.7 and vLLM. Gemini CLI says that this is a bug in the inference engine (in my case vLLM). According to the OpenAI API specification, an id in the first chunk of a tool call is mandatory. AI SDK is very strict and enforces this: https://github.com/vercel/ai/blob/c041f749c58cd6669a0abadccc7530e8949bf532/packages/openai-compatible/src/chat/openai-compatible-chat-language-model.ts#L464
stromseng commentedon Jan 16, 2026
See my short writeup at BerriAI/litellm#13124 (comment) , using GLM 4.7 hosted via litellm and encountering a similar issue.
Ununnilium commentedon Jan 18, 2026
For me, it just works now with GLM-4.7 after updating to the latest vLLM nightly. I think there was a bug in vLLM which was fixed. It also works through LiteLLM.
For other people having the same problem, you can use mitmproxy to see the exact tool calls in the HTTP responses . First, start mitmweb (part of mitmproxy). Then, before starting opencode, set the following variables:
Now, try one time the problematic API of the LLM and one time a proper working version (e.g. GLM-4.7 OpenCode Zen) with a simple prompt. You can then compare the HTTP response to the same prompt e.g. with Gemini. With this information, you can the easier report the problem e.g. to the inference engine or the API provider.
github-actions commentedon Mar 27, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.