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
Error "reasoning part reasoning-0 not found" from tool calls using GLM 4.5 Air #6486
I just updated OpenCode from v1.0.163 to v1.0.218 and now tool calls using GLM 4.5 Air result in an error "reasoning part reasoning-0 not found". Prior to updating OpenCode the model had no issues calling tools. It appears that the tool calls finish and the model is able to see the results of the tool call, but is not able to respond. If prompted to continue, it was able to respond as if no error occurred for a while until eventually every prompt to continue resulted in the error.
I am having the same issue with 1.1.8. I reverted the #6463 locally and the issue really seems to be gone, however, the thinking block is not differentiated from the response (the ... is part of the response). In my case I run GLM 4.6V Flash in llama.cpp.
@rmhubbert I am wondering, is the different result related to different templates used in vLLM and llama.cpp? I noticed the --chat-template-file ./templates/glm-4.5-air-chat-template.jinja parameter in your llama.cpp command. I am having this issue with default template in llama.cpp and you have the same issue in vLLM, which most probably runs also with default template, right?
This issue is due to the LLM endpoint returning an empty thinking block that is not parsed correctly in the extractReasoningMiddleware function in the Vercel AI module. I have submitted a PR in Vercel's ai repo detailing the fix, which you can implement yourself in the meantime too.
Update: The PR has been approved and included in the latest release of the ai SDK (v6.0.64).
However, opencode is using v5.0.124 at the time of writing, and based on my previous tests while patching, v6.0.0 onwards introduces changes that will break opencode. I have not looked into detail on what's the issue (and if the issue still exists).
I worked around by patching v5.0.119 and linked the local patch to opencode.
Interesting! Something has changed with Opencode 1.1.48. I noticed that the ai-sdk library version was bumped to the latest v5 version, so maybe @jovanwongzixi's fix was backported to v5?
Anyway, I am no longer seeing the original reasoning part reasoning-0 not found error after tool calls when running GLM 4.5 Air on vLLM. There is a new issue; All output after the initial tool call is wrapped in <think></think> tags, but the task does now complete.
Interesting! Something has changed with Opencode 1.1.48. I noticed that the ai-sdk library version was bumped to the latest v5 version, so maybe @jovanwongzixi's fix was backported to v5?
Anyway, I am no longer seeing the original reasoning part reasoning-0 not found error after tool calls when running GLM 4.5 Air on vLLM. There is a new issue; All output after the initial tool call is wrapped in <think></think> tags, but the task does now complete.
Are you able to share more details on how to replicate the issue and/or possibly some screenshots? I'm unlikely to have time to look into this anytime soon but it could possibly help others who are willing to take a look at it 😄
Activity
github-actions commentedon Dec 30, 2025
This issue might be a duplicate of existing issues. Please check:
signatureinthinkingblock #6418: Error: Invalidsignatureinthinkingblock - Related issue with thinking block errors when switching between GLM models and other providersFeel free to ignore if none of these address your specific case.
rekram1-node commentedon Dec 30, 2025
cann u share your config?
jhov94 commentedon Dec 30, 2025
I also tried it with no options defined for the model since I'm not sure if those options are model specific or not. Here's my config:
onurakman commentedon Jan 2, 2026
I got the same error with GLM-4.5-Air after upgrading to v1.0.223
Sometimes GLM outputs
<think></think>empty tags with may be this is causing problemonurakman commentedon Jan 5, 2026
I tried with version 1.1.2 and the problem still exits. The change added in version 1.0.218 #6463 causes problems with GLM models.
jnvitr commentedon Jan 6, 2026
Also having this error with GLM 4.5 Air on latest opencode on win. Running model local FP8
rekram1-node commentedon Jan 6, 2026
ahh
arkamar commentedon Jan 9, 2026
I am having the same issue with 1.1.8. I reverted the #6463 locally and the issue really seems to be gone, however, the thinking block is not differentiated from the response (the ... is part of the response). In my case I run GLM 4.6V Flash in llama.cpp.
rmhubbert commentedon Jan 24, 2026
I'm seeing this as well, but only on vLLM. My llama.cpp version does not throw the error.
In vLLM, the error is thrown on the first tool call attempt.
I'm running https://huggingface.co/cyankiwi/GLM-4.5-Air-AWQ-4bit via vLLM v0.14.0, with Opencode v1.1.34 on an up to date Arch Linux.
EDIT: I'm also seeing the error when using https://huggingface.co/QuantTrio/GLM-4.5-Air-AWQ-FP16Mix in vLLM.
My vLLM config is as follows (via llama-swap)
My working llama.cpp config is as follows
The relevant part of my opencode.json
mkondakov commentedon Jan 26, 2026
I have the same issue
My setup:
opencode v1.1.36 on mac
LM Studio 0.3.39 + zai-org/glm-4.6v-flash on windows
vim-reaper commentedon Jan 26, 2026
Downgrading to v1.0.201 is a workaround.
arkamar commentedon Jan 27, 2026
@rmhubbert I am wondering, is the different result related to different templates used in vLLM and llama.cpp? I noticed the
--chat-template-file ./templates/glm-4.5-air-chat-template.jinjaparameter in your llama.cpp command. I am having this issue with default template in llama.cpp and you have the same issue in vLLM, which most probably runs also with default template, right?jovanwongzixi commentedon Jan 27, 2026
This issue is due to the LLM endpoint returning an empty thinking block that is not parsed correctly in the
extractReasoningMiddlewarefunction in the Vercel AI module. I have submitted a PR in Vercel's ai repo detailing the fix, which you can implement yourself in the meantime too.The PR can be found at vercel/ai#12055
rmhubbert commentedon Jan 30, 2026
Thanks @jovanwongzixi, much appreciated!
@arkamar It was definitely worth a shot, but unfortunately, running my vLLM instances with the same explicit template file didn't make any difference.
jovanwongzixi commentedon Jan 31, 2026
Update: The PR has been approved and included in the latest release of the ai SDK (v6.0.64).
However, opencode is using v5.0.124 at the time of writing, and based on my previous tests while patching, v6.0.0 onwards introduces changes that will break opencode. I have not looked into detail on what's the issue (and if the issue still exists).
I worked around by patching v5.0.119 and linked the local patch to opencode.
rmhubbert commentedon Feb 2, 2026
Interesting! Something has changed with Opencode 1.1.48. I noticed that the ai-sdk library version was bumped to the latest v5 version, so maybe @jovanwongzixi's fix was backported to v5?
Anyway, I am no longer seeing the original
reasoning part reasoning-0 not founderror after tool calls when running GLM 4.5 Air on vLLM. There is a new issue; All output after the initial tool call is wrapped in<think></think>tags, but the task does now complete.jovanwongzixi commentedon Feb 2, 2026
Are you able to share more details on how to replicate the issue and/or possibly some screenshots? I'm unlikely to have time to look into this anytime soon but it could possibly help others who are willing to take a look at it 😄
github-actions commentedon Apr 4, 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.