Skip to content

GLM 5.1 on NVIDIA can hang on unnamed tool calls during memory bootstrap #25970

@ctharvey

Description

@ctharvey

Description

Using nvidia/z-ai/glm-5.1, the provider can return finish_reason: "tool_calls" while omitting both the tool call id and function.name from the streamed payload. When that happens during memory bootstrap, opencode can end up stalling instead of either recovering or failing clearly.

This looks like a provider payload issue, but opencode should still handle it more gracefully.

Related reports: #25786, #24137, #6649, #10885.

Plugins

cth.mcp.memory

OpenCode version

0.0.0-dev-202605060426

Steps to reproduce

  1. Configure nvidia/z-ai/glm-5.1.
  2. Run opencode run --format json --dangerously-skip-permissions -m nvidia/z-ai/glm-5.1 "check your memory".
  3. Observe that the model enters a tool-call path where the provider may emit arguments without a tool name/id, and the session can stall instead of resolving into a usable tool call or a clear error.

A representative malformed streamed payload looked like:

{
  "finish_reason": "tool_calls",
  "delta": {
    "tool_calls": [
      {
        "function": {
          "arguments": "{}"
        }
      }
    ]
  }
}

Screenshot and/or share link

N/A

Operating System

Windows 11

Terminal

PowerShell 7 / Windows Terminal

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions