Skip to content

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

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

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