GLM-4.7 worker sub-agent fails to invoke tools - generates simulated output instead of actual tool calls #6950

Closed
opened 2026-02-16 18:05:42 -05:00 by yindo · 2 comments
Owner

Originally created by @valeralebedz on GitHub (Jan 20, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

Summary

When using GLM-4.7 as the model, worker sub-agents fail to actually execute tools. Instead, the model generates text that describes tool calls without making real function invocations. This results in fabricated/hallucinated results and no actual file changes.

Expected Behavior

  • Worker Task UI should appear showing tool call count and individual tool invocations
  • Worker should actually read filesystem and report accurate state
  • File operations should result in actual file changes

Actual Behavior with GLM-4.7

  • No Worker Task UI appears (no tool call trace to render)
  • Worker reports fabricated filesystem state (claimed workspace was "empty" when directories existed)
  • Worker reports .gitignore had "comprehensive Node.js patterns" when it only contained .DS_Store
  • No actual file changes despite "SUCCESS" status
  • Model writes bash(command=...) as prose text instead of making actual function calls

Comparison Evidence

I ran the identical prompt with two different models:

Aspect GLM-4.7 Minimax-m2.1-free
Worker Task UI Missing Shows "13 toolcalls"
Workspace state Reported "empty" Found .opencode/, .specify/, work/
.gitignore analysis "Comprehensive Node.js patterns" Correctly found only .DS_Store
File changes None Updated to 47 lines
Execution time 29.9s 96.1s

Root Cause Hypothesis

GLM-4.7 may not properly support the function/tool calling API format that opencode uses, causing it to fall back to text generation that simulates tool use rather than actually invoking tools.

Plugins

None

OpenCode version

1.1.27

Steps to reproduce

  1. Configure GLM-4.7 as your model in opencode
  2. Run a task that requires worker sub-agent with tool use, e.g.:
    can you run worker and ask it to improve our gitignore based on the current workspace structure?
    
  3. Observe that:
    • Worker Task UI does not appear (no tool calls rendered)
    • Worker returns "SUCCESS" with fabricated results
    • No actual file changes occur
  4. Run the same prompt with a different model (e.g., minimax-m2.1-free) to confirm tools work correctly with other models

Screenshot and/or share link

Worker Task UI with working model (minimax):

Image

Important

This UI does NOT appear when using GLM-4.7. After the task completes, I only see:

◉ Worker Task "Improve .gitignore based on workspace"

With Minimax, there's an expandable sub-agent panel below this showing tool calls (e.g., "13 toolcalls") that I can click to inspect the session. With GLM-4.7, this panel is completely absent — no tool call count, no session to view. This confirms zero actual tool invocations occurred. See the screenshot below

Image

Full session transcripts attached below showing identical prompts with different results.

glm-4.7-transcript.md
minimax-m2.1-free-transcript.md

My opencode.json

opencode.json

Operating System

macOS 26.2 (25C56)

Terminal

Ghostty 1.2.3

Originally created by @valeralebedz on GitHub (Jan 20, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description ## Summary When using GLM-4.7 as the model, worker sub-agents fail to actually execute tools. Instead, the model generates text that *describes* tool calls without making real function invocations. This results in fabricated/hallucinated results and no actual file changes. ## Expected Behavior - Worker Task UI should appear showing tool call count and individual tool invocations - Worker should actually read filesystem and report accurate state - File operations should result in actual file changes ## Actual Behavior with GLM-4.7 - **No Worker Task UI appears** (no tool call trace to render) - Worker reports fabricated filesystem state (claimed workspace was "empty" when directories existed) - Worker reports `.gitignore` had "comprehensive Node.js patterns" when it only contained `.DS_Store` - No actual file changes despite "SUCCESS" status - Model writes `bash(command=...)` as prose text instead of making actual function calls ## Comparison Evidence I ran the identical prompt with two different models: | Aspect | GLM-4.7 | Minimax-m2.1-free | |--------|---------|-------------------| | Worker Task UI | **Missing** | Shows "13 toolcalls" | | Workspace state | Reported "empty" | Found `.opencode/`, `.specify/`, `work/` | | .gitignore analysis | "Comprehensive Node.js patterns" | Correctly found only `.DS_Store` | | File changes | None | Updated to 47 lines | | Execution time | 29.9s | 96.1s | ## Root Cause Hypothesis GLM-4.7 may not properly support the function/tool calling API format that opencode uses, causing it to fall back to text generation that simulates tool use rather than actually invoking tools. ### Plugins None ### OpenCode version 1.1.27 ### Steps to reproduce 1. Configure GLM-4.7 as your model in opencode 2. Run a task that requires worker sub-agent with tool use, e.g.: ``` can you run worker and ask it to improve our gitignore based on the current workspace structure? ``` 3. Observe that: - Worker Task UI does not appear (no tool calls rendered) - Worker returns "SUCCESS" with fabricated results - No actual file changes occur 4. Run the same prompt with a different model (e.g., minimax-m2.1-free) to confirm tools work correctly with other models ### Screenshot and/or share link **Worker Task UI with working model (minimax):** <img width="850" height="3256" alt="Image" src="https://github.com/user-attachments/assets/44d5f1a1-6ffb-44d7-afa2-0e1f1279ef50" /> > [!IMPORTANT] > **This UI does NOT appear when using GLM-4.7.** After the task completes, I only see: > > `◉ Worker Task "Improve .gitignore based on workspace"` > > With Minimax, there's an expandable sub-agent panel below this showing tool calls (e.g., "13 toolcalls") that I can click to inspect the session. With GLM-4.7, this panel is completely absent — no tool call count, no session to view. This confirms zero actual tool invocations occurred. See the screenshot below <img width="868" height="3262" alt="Image" src="https://github.com/user-attachments/assets/77484c74-4ba9-436e-9f36-af3598c45a48" /> **Full session transcripts attached below showing identical prompts with different results.** [glm-4.7-transcript.md](https://github.com/user-attachments/files/24739904/glm-4.7-transcript.md) [minimax-m2.1-free-transcript.md](https://github.com/user-attachments/files/24739905/minimax-m2.1-free-transcript.md) **My opencode.json** [opencode.json](https://github.com/user-attachments/files/24739951/opencode.json) ### Operating System macOS 26.2 (25C56) ### Terminal Ghostty 1.2.3
yindo added the bugzen labels 2026-02-16 18:05:42 -05:00
yindo closed this issue 2026-02-16 18:05:42 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 20, 2026):

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

  • #6708: GLM 4.7 on Zai coding plan puts tool calls inside the thinking/reasoning tag - Similar tool calling issues with GLM-4.7
  • #7779: GLM 4.7 thinking process not properly formatted - Related GLM-4.7 parsing and formatting issues
  • #7692: JSON Parse Error with Zhipu GLM-4.7: Stream chunks are concatenated incorrectly - GLM-4.7 JSON parsing issues
  • #8431: GLM 4.7 AI_JSONParseError - Another GLM-4.7 parsing issue
  • #9383: The output includes tool invocations - Related to tool invocation/execution issues where tools generate text instead of actual calls

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 20, 2026): This issue might be a duplicate of existing issues. Please check: - #6708: GLM 4.7 on Zai coding plan puts tool calls inside the thinking/reasoning tag - Similar tool calling issues with GLM-4.7 - #7779: GLM 4.7 thinking process not properly formatted - Related GLM-4.7 parsing and formatting issues - #7692: JSON Parse Error with Zhipu GLM-4.7: Stream chunks are concatenated incorrectly - GLM-4.7 JSON parsing issues - #8431: GLM 4.7 AI_JSONParseError - Another GLM-4.7 parsing issue - #9383: The output includes tool invocations - Related to tool invocation/execution issues where tools generate text instead of actual calls Feel free to ignore if none of these address your specific case.
Author
Owner

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

No longer can replicate, one of the recent releases must have resolved this. Thank you

@valeralebedz commented on GitHub (Jan 22, 2026): No longer can replicate, one of the recent releases must have resolved this. Thank you
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6950