Skip to content

[bug] GLM 5 keeps screwing up the json parsing of read tool calling #13982

Closed as not planned

Description

@YukariMindGap

Description

I've been using GLM 5 from NanoGPT for a while, running opencode cli inside VS Code. But lately there's an increase of tendency for the ai to get stuck in a loop due to tool calling errors, mostly on the "read" tool. I have no idea what's happening but apparently the ai keeps screwing up the JSON formatting for the tool calling. Sometimes i even get "Method Not Allowed" errors that stops the build dead in the tracks. I thought it's the Superpowers plugin i've installed but i've made a clean reinstall and the errors persist.

I've attached some error logs while testing on a test project.

Plugins

None. it's a fresh install

OpenCode version

1.2.6

Steps to reproduce

  1. Go to a provider that offers GLM-5 (I use NanoGPT for this instance, but i think other providers might also be affected)
  2. Switch model to GLM-5 Thinking (Haven't tested in non-thinking one and i think other chinese models might have this problem)
  3. Create a test project with some files with contents inside
  4. Ask the ai to try reading those files and summarize them to you.
  5. Watch the reasoning logs and the occasional build-stopping error.

Screenshot and/or share link

Image Image

Operating System

Windows 11

Terminal

Windows Terminal in VS Code

Activity

  1. github-actions commented on Feb 17, 2026

    @github-actions
    Contributor

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

    These issues describe very similar symptoms with GLM models producing malformed JSON during tool calls. The #13900 issue is particularly similar as it also reports GLM-5 with malformed JSON errors in v1.2.6.

  2. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Feb 17, 2026
  3. YukariMindGap commented on Feb 17, 2026

    @YukariMindGap
    Author

    I tried downgrading from 1.2.6 to 1.2.4 but the error still persists

  4. rekram1-node commented on Feb 17, 2026

    @rekram1-node
    Contributor

    @YukariMindGap can u send me the session?

    opencode export > session.json

    RUN this exact command in your terminal, select the session and send me the json file from the output.

  5. YukariMindGap commented on Feb 17, 2026

    @YukariMindGap
    Author

    @YukariMindGap can u send me the session?

    opencode export > session.json

    RUN this exact command in your terminal, select the session and send me the json file from the output.

    session.json

    here it is

    @rekram1-node

  6. YukariMindGap commented on Feb 18, 2026

    @YukariMindGap
    Author

    I also get this problem from Qwen 3.5 and Kimi 2.5, so i think that might be an issue of the models themselves. Haven't tried on GPT 5.2, Claude 4.5 Opus/ 4.6 Sonnet, or Gemini 3 Pro.

  7. flyboat403 commented on Feb 19, 2026

    @flyboat403

    I also get same problem

  8. YukariMindGap commented on Feb 19, 2026

    @YukariMindGap
    Author

    I also get this problem from Qwen 3.5 and Kimi 2.5, so i think that might be an issue of the models themselves. Haven't tried on GPT 5.2, Claude 4.5 Opus/ 4.6 Sonnet, or Gemini 3 Pro.

    Minimax 2.5, oddly enough, doesn't have this problem. I was testing Qwen 3.5 and Kimi 2.5 with the thinking model, so that might be a problem

  9. YukariMindGap commented on Feb 24, 2026

    @YukariMindGap
    Author

    I think the malformed json has been mostly fixed by itself, but now i got this problem where tool calling keeps coming up with "missing". I've found no reason why this happened.

  10. nkosi23 commented on Mar 10, 2026

    @nkosi23

    I think the malformed json has been mostly fixed by itself, but now i got this problem where tool calling keeps coming up with "missing". I've found no reason why this happened.

    Have the same issue

  11. removed
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  12. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions