You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] GLM-5 via NVIDIA NIM emits malformed MCP tool JSON (Expected '}') in OpenCode v1.2.6 #13900
I’m unsure whether root cause is parser-side, stream chunk handling, provider behavior, or interaction between them; sharing this report in case the 1.2.x + GLM-5 + NIM combination has a distinct failure mode.
I have the same problem as you, however i'm using NanoGPT as my endpoint and i still get the issue. I also get this problem from Qwen 3.5 and Kimi 2.5.
Reproduced the GLM-5 failure again a few minutes ago and captured clean artifacts. Highlights:
macOS 26.3, OpenCode CLI 1.2.15.
Command: opencode run --model nvidia/z-ai/glm5 "Quick smoke test".
OpenCode log line 115 shows the agent handing off to providerID=nvidia modelID=z-ai/glm5, after which no tokens ever arrive and the CLI eventually times out.
A direct OpenAI-compatible call to https://integrate.api.nvidia.com/v1/chat/completions with the same API key immediately returns HTTP/2 500 with nvcf-reqid: 83cc2550-a234-445d-b5b4-7da6b35e4497 and body {"error":{"message":"EngineCore encountered an issue..."}}, so the crash is upstream of OpenCode.
The captured headers/body show the same HTTP/2 500 with the request ID above; happy to upload the raw files if anyone needs them.
OpenCode log (2026-03-05T22:40:23Z run)
That log records the CLI handing off to the NVIDIA provider, receiving no tokens, and timing out. I can attach the file if it would be useful; omitted here to avoid referencing local paths that others cannot access.
Quick reproduction data from macOS 26.3 running OpenCode CLI 1.2.15 with providerID=nvidia / modelID=z-ai/glm5 (opencode run --model nvidia/z-ai/glm5 "Quick smoke test"):
(Earlier retries with provider=openai / model=gpt-5.3-codex showed the same AI_APICallError loop; keeping that snippet here until I capture a glm5-specific log.)
Activity
github-actions commentedon Feb 16, 2026
This issue might be a duplicate of or closely related to existing issues. Please check:
While this report is specific to GLM-5 via NVIDIA NIM, the underlying JSON parsing failure pattern appears consistent with these existing issues.
chindris-mihai-alexandru commentedon Feb 16, 2026
Update: also reported upstream on NVIDIA Developer Forums with the same repro and error signature:
https://forums.developer.nvidia.com/t/nim-glm-5-malformed-tool-call-json-missing-via-openai-compatible-endpoint-opencode/360809
This should help confirm whether root cause is model output, serving/stream chunking, or client-side parser recovery in this stack combination.
chindris-mihai-alexandru commentedon Feb 16, 2026
Added minimal reproducible prompt + exact malformed payloads gist: https://gist.github.com/chindris-mihai-alexandru/f3c114915f18618406030e6a2d8fa59b
rekram1-node commentedon Feb 17, 2026
yeah the nvidia provider has been giving me some weirdness, it says openai compat but maybe there is something we arent properly sending them...
YukariMindGap commentedon Feb 17, 2026
I have the same problem as you, however i'm using NanoGPT as my endpoint and i still get the issue. I also get this problem from Qwen 3.5 and Kimi 2.5.
aryulianto commentedon Feb 18, 2026
I also encountered this issue with self-hosted GLM‑5 FP8 in OpenCode v1.2.5 and v1.2.6, both the CLI and desktop versions.
CodingRookie98 commentedon Feb 18, 2026
I also encountered this issue with nvidia provider.
allanchan339 commentedon Feb 24, 2026
Per https://build.nvidia.com/z-ai/glm5/modelcard, glm5 in NIM use SGLang as inference engine, so i think SGLang should have same report ? @chindris-mihai-alexandru
chindris-mihai-alexandru commentedon Feb 25, 2026
I thin you're right. Opened upstream tracking issue in SGLang too: sgl-project/sglang#19345
openzeka-birol-kuyumcu commentedon Mar 3, 2026
same problem with vllm serving over Dgx-B300
chindris-mihai-alexandru commentedon Mar 5, 2026
Reproduced the GLM-5 failure again a few minutes ago and captured clean artifacts. Highlights:
opencode run --model nvidia/z-ai/glm5 "Quick smoke test".providerID=nvidia modelID=z-ai/glm5, after which no tokens ever arrive and the CLI eventually times out.https://integrate.api.nvidia.com/v1/chat/completionswith the same API key immediately returns HTTP/2 500 withnvcf-reqid: 83cc2550-a234-445d-b5b4-7da6b35e4497and body{"error":{"message":"EngineCore encountered an issue..."}}, so the crash is upstream of OpenCode.Direct curl repro
The captured headers/body show the same HTTP/2 500 with the request ID above; happy to upload the raw files if anyone needs them.
OpenCode log (2026-03-05T22:40:23Z run)
That log records the CLI handing off to the NVIDIA provider, receiving no tokens, and timing out. I can attach the file if it would be useful; omitted here to avoid referencing local paths that others cannot access.
chindris-mihai-alexandru commentedon Mar 5, 2026
Quick reproduction data from macOS 26.3 running OpenCode CLI 1.2.15 with providerID=nvidia / modelID=z-ai/glm5 (
opencode run --model nvidia/z-ai/glm5 "Quick smoke test"):(Earlier retries with provider=openai / model=gpt-5.3-codex showed the same AI_APICallError loop; keeping that snippet here until I capture a glm5-specific log.)
opencode-debug-snippets.txtopencode-error-snippets.txtFull structured session log (already redacted) is in this gist: https://gist.github.com/chindris-mihai-alexandru/cfa84780015dc417b550170c52d98db6
MoshiLL commentedon Mar 12, 2026
I also encountered this issue with self-hosted GLM‑5 FP8 in claude code
github-actions commentedon May 12, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.