Summary
When using z-ai/glm5 through NVIDIA NIM in OpenCode, tool calls intermittently contain malformed JSON arguments (missing/truncated braces), causing repeated parse failures and retry loops.
Example error
Invalid input for tool tavily_tavily_search: JSON parsing failed: Text: {\"query\":\"Geoffrey Huntley LinkedIn Ralph Wiggum most viral reposts\".
Error message: JSON Parse error: Expected '}'
Also observed for multiple tools in the same session (tavily_tavily_search, brave-search_brave_web_search, webfetch).
Environment
- Client: OpenCode
1.2.6
- Model:
z-ai/glm5
- Provider: NVIDIA NIM (
https://integrate.api.nvidia.com/v1)
- OS: macOS Sequoia 15.7.4
Reproduction
- Configure OpenCode with
z-ai/glm5 via NVIDIA NIM.
- Ask for a web research task that triggers multiple tool calls.
- Observe occasional malformed tool JSON payloads and repeated retries.
Expected
Tool-call arguments are valid strict JSON.
Actual
Occasional malformed JSON payloads (e.g., missing closing }), causing parser failures and agent loops.
Notes
If there is a preferred GLM-5 parser/config for strict tool-calling compatibility via OpenAI-compatible endpoints, please share it.
Summary
When using
z-ai/glm5through NVIDIA NIM in OpenCode, tool calls intermittently contain malformed JSON arguments (missing/truncated braces), causing repeated parse failures and retry loops.Example error
Also observed for multiple tools in the same session (
tavily_tavily_search,brave-search_brave_web_search,webfetch).Environment
1.2.6z-ai/glm5https://integrate.api.nvidia.com/v1)Reproduction
z-ai/glm5via NVIDIA NIM.Expected
Tool-call arguments are valid strict JSON.
Actual
Occasional malformed JSON payloads (e.g., missing closing
}), causing parser failures and agent loops.Notes
If there is a preferred GLM-5 parser/config for strict tool-calling compatibility via OpenAI-compatible endpoints, please share it.