[GH-ISSUE #13820] Error using tools with glm-4.7-flash #9052

Open
opened 2026-04-12 21:52:48 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @rottedfrog on GitHub (Jan 21, 2026).
Original GitHub issue: https://github.com/ollama/ollama/issues/13820

What is the issue?

when using glm-4.7-flash:latest with claude code, it frequently stops and loses all context - looking at the logs I get the attached error whenever it happens.

Relevant log output

Jan 20 13:27:49 tartarus-lx ollama[4078349]: time=2026-01-20T13:27:49.426Z level=WARN source=glm46.go:89 msg="glm-4.6 tool call parsing failed" error="failed to parse XML: XML syntax error on line 1: element <tool_call> closed by </arg_key>"

OS

Linux

GPU

AMD

CPU

AMD

Ollama version

0.14.3

Originally created by @rottedfrog on GitHub (Jan 21, 2026). Original GitHub issue: https://github.com/ollama/ollama/issues/13820 ### What is the issue? when using `glm-4.7-flash:latest` with claude code, it frequently stops and loses all context - looking at the logs I get the attached error whenever it happens. ### Relevant log output ```shell Jan 20 13:27:49 tartarus-lx ollama[4078349]: time=2026-01-20T13:27:49.426Z level=WARN source=glm46.go:89 msg="glm-4.6 tool call parsing failed" error="failed to parse XML: XML syntax error on line 1: element <tool_call> closed by </arg_key>" ``` ### OS Linux ### GPU AMD ### CPU AMD ### Ollama version 0.14.3
GiteaMirror added the bug label 2026-04-12 21:52:48 -05:00
Author
Owner

@sommarnatt commented on GitHub (Jan 21, 2026):

I think you need to wait for the updated model - if this one is from yesterday, then at least 1 fix has been added since then.

https://www.reddit.com/r/LocalLLaMA/comments/1qih9r8/current_glm47flash_implementation_confirmed_to_be/
https://www.reddit.com/r/unsloth/comments/1qiu5w8/glm47flash_ggufs_updated_now_produces_much_better/

<!-- gh-comment-id:3780308510 --> @sommarnatt commented on GitHub (Jan 21, 2026): I think you need to wait for the updated model - if this one is from yesterday, then at least 1 fix has been added since then. https://www.reddit.com/r/LocalLLaMA/comments/1qih9r8/current_glm47flash_implementation_confirmed_to_be/ https://www.reddit.com/r/unsloth/comments/1qiu5w8/glm47flash_ggufs_updated_now_produces_much_better/
Author
Owner

@bherw commented on GitHub (Jan 22, 2026):

I'm using the updated model from unsloth, and both opencode and claude code just immediately report a 400 error from ollama that the model "does not support tools" and don't even try to do anything.

<!-- gh-comment-id:3781899908 --> @bherw commented on GitHub (Jan 22, 2026): I'm using the updated model from unsloth, and both opencode and claude code just immediately report a 400 error from ollama that the model "does not support tools" and don't even try to do anything.
Author
Owner

@rick-github commented on GitHub (Jan 22, 2026):

@bherw HF models generally don't come with the template that ollama uses to detect capabilities. Either use the model from the ollama library, or merge the library Modelfile with the HF GGUF.

<!-- gh-comment-id:3783558948 --> @rick-github commented on GitHub (Jan 22, 2026): @bherw HF models generally don't come with the template that ollama uses to detect capabilities. Either use the model from the ollama library, or merge the library Modelfile with the HF GGUF.
Author
Owner

@ParthSareen commented on GitHub (Jan 23, 2026):

Hi @bherw - we have our own parsers which work differently than other templates. YMMV for models outside of Ollama.

@rottedfrog what context length are you running with? I'm finding this model needs more context length and shifting does not work well with tools.

<!-- gh-comment-id:3788325225 --> @ParthSareen commented on GitHub (Jan 23, 2026): Hi @bherw - we have our own parsers which work differently than other templates. YMMV for models outside of Ollama. @rottedfrog what context length are you running with? I'm finding this model needs more context length and shifting does not work well with tools.
Author
Owner

@balki commented on GitHub (Jan 23, 2026):

Tools worked for me with opencode (with 64K and 128K context)

<!-- gh-comment-id:3791931166 --> @balki commented on GitHub (Jan 23, 2026): Tools worked for me with opencode (with 64K and 128K context)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#9052