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
Malformed thinking block in toolcall (glm-4.7-free) #6039
There seems to be a malformed tool call in the thinking block on the glm-4.7-free available via opencode zen. I understand it's in beta, but I wanted to report this just in case, since there was no feedback button within opencode. I had to re-ask but was confused on whether the chat was still ongoing because it had stopped but I re-asked the question again (see screenshots attached)
oh this is really sad for me :(
I was working on a PR to to detect and extract the tool call from inside the thinking block cuz I assumed it was a GLM issue that required normalization in packages/opencode/src/provider/transform.ts
if u are still running into it it is entirely dependent on ir provider, if opencode is properly sending thinking chunks (the interleaved setting for model is correct) then it is on the provider of the model to properly parse the tool calls out and send them as such
Activity
github-actions commentedon Dec 23, 2025
This issue might be a duplicate of existing issues. Please check:
thinkingorredacted_thinking, but foundtool_use#3077: Expectedthinkingorredacted_thinking, but foundtool_use- related thinking block ordering problemsFeel free to ignore if your specific case with glm-4.7-free differs from these issues.
ramarivera commentedon Dec 23, 2025
+1ing this one, the "it seems to have stopped completely" thing happens both on Zen GLM 4.7 and Z.AI coding plan's
rekram1-node commentedon Dec 23, 2025
glm-4.7-free was incorrectly not configured as an interleaved reasoning model.
This should be fixed if you do
opencode models --refreshYour cache will automatically refresh but this just forces it to so that you can have the fix sooner
rekram1-node commentedon Dec 23, 2025
fix
ramarivera commentedon Dec 23, 2025
oh this is really sad for me :(
I was working on a PR to to detect and extract the tool call from inside the thinking block cuz I assumed it was a GLM issue that required normalization in
packages/opencode/src/provider/transform.tsGuess I should have asked first 😓
ramarivera commentedon Dec 24, 2025
so, even with this fix, I still get tool calls in thinking blocks which causes the opencode workflow to stop e.g.
EDIT: more examples
crystech commentedon Dec 25, 2025
+1 here. same issues on GLM 4.7 local llm
rekram1-node commentedon Dec 25, 2025
if u are still running into it it is entirely dependent on ir provider, if opencode is properly sending thinking chunks (the interleaved setting for model is correct) then it is on the provider of the model to properly parse the tool calls out and send them as such
fix: configure GLM-4.7 as interleaved reasoning model