GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Malformed thinking block in toolcall (glm-4.7-free) · Issue #6039 · anomalyco/opencode

Malformed thinking block in toolcall (glm-4.7-free) #6039

New issue
Copy link
New issue
Copy link
Closed
Closed
Malformed thinking block in toolcall (glm-4.7-free)#6039
Copy link
Assignees
fwang
Labels
bugSomething isn't workingzenRelates to Zen

Description

@kevingatera
kevingatera
opened on Dec 23, 2025
Issue body actions

Description

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)

OpenCode version

1.0.191

Steps to reproduce

It's intermittent so I am not sure

Screenshot and/or share link

Image Image

Operating System

linux (Nobara)

Terminal

N/A

Activity

  1. kevingatera
    added
    bugSomething isn't working
    on Dec 23, 2025
  2. github-actions
    assigned
    fwang
    on Dec 23, 2025
  3. github-actions
    added
    zenRelates to Zen
    on Dec 23, 2025
  4. github-actions commented on Dec 23, 2025

    @github-actions
    github-actionsBot
    on Dec 23, 2025 – with GitHub Actions
    Contributor
    More actions

    This issue might be a duplicate of existing issues. Please check:

    • SSE Stream Bug: Out-of-Order thinking_delta via LiteLLM → AWS Bedrock #3596: SSE Stream Bug: Out-of-Order thinking_delta via LiteLLM → AWS Bedrock - similar malformed thinking block issues in streaming
    • Expected thinking or redacted_thinking, but found tool_use #3077: Expected thinking or redacted_thinking, but found tool_use - related thinking block ordering problems
    • Loop in certain models #3743: Loop in certain models - GLM models occasionally showing tool call malfunction issues
    • GLM-4.6 model gets stuck in infinite loop, repeating same actions #3444: GLM-4.6 model gets stuck in infinite loop - similar behavior with GLM models getting stuck on tool calls

    Feel free to ignore if your specific case with glm-4.7-free differs from these issues.

  5. ramarivera commented on Dec 23, 2025

    @ramarivera
    ramarivera
    on Dec 23, 2025
    More actions

    +1ing this one, the "it seems to have stopped completely" thing happens both on Zen GLM 4.7 and Z.AI coding plan's

  6. rekram1-node commented on Dec 23, 2025

    @rekram1-node
    rekram1-node
    on Dec 23, 2025
    Member
    More actions

    glm-4.7-free was incorrectly not configured as an interleaved reasoning model.

    This should be fixed if you do opencode models --refresh

    Your cache will automatically refresh but this just forces it to so that you can have the fix sooner

  7. rekram1-node
    closed this as completedon Dec 23, 2025
  8. rekram1-node commented on Dec 23, 2025

    @rekram1-node
    rekram1-node
    on Dec 23, 2025
    Member
    More actions

    fix

  9. ramarivera commented on Dec 23, 2025

    @ramarivera
    ramarivera
    on Dec 23, 2025
    More actions

    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

    Guess I should have asked first 😓

  10. ramarivera commented on Dec 24, 2025

    @ramarivera
    ramarivera
    on Dec 24, 2025
    More actions

    so, even with this fix, I still get tool calls in thinking blocks which causes the opencode workflow to stop e.g.

    Thinking: <tool_call>bash<arg_key>command</arg_key><arg_value>cat packages/portal/.generation-cache.json | jq '."volume", "artifact", "generatedAt", "tokens" | select(.volume == "openspec") | .artifact | .generatedAt | .tokens' 2>/dev/null</arg_value><arg_key>description</arg_key><arg_value>Check cache for openspec artifacts</arg_value></tool_call>
    

    EDIT: more examples

    Thinking: <tool_call>use_skill<arg_key>skill</arg_key><arg_value>handoff</arg_value></tool_call>
    
    Reacted by Danila Poyarkov and zizineco
  11. crystech commented on Dec 25, 2025

    @crystech
    crystech
    on Dec 25, 2025
    More actions

    so, even with this fix, I still get tool calls in thinking blocks which causes the opencode workflow to stop e.g.

    Thinking: <tool_call>bash<arg_key>command</arg_key><arg_value>cat packages/portal/.generation-cache.json | jq '."volume", "artifact", "generatedAt", "tokens" | select(.volume == "openspec") | .artifact | .generatedAt | .tokens' 2>/dev/null</arg_value><arg_key>description</arg_key><arg_value>Check cache for openspec artifacts</arg_value></tool_call>
    

    EDIT: more examples

    Thinking: <tool_call>use_skill<arg_key>skill</arg_key><arg_value>handoff</arg_value></tool_call>
    

    +1 here. same issues on GLM 4.7 local llm

  12. rekram1-node commented on Dec 25, 2025

    @rekram1-node
    rekram1-node
    on Dec 25, 2025
    Member
    More actions

    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

  13. lkonga
    added a commit that references this issue on Jan 2, 2026

    fix: configure GLM-4.7 as interleaved reasoning model

    c02eea8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @fwang
    fwang

Labels

bugSomething isn't workingzenRelates to Zen

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.