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
SSE streaming parse error with GLM-4.7 responses #8282
Using opencode with GLM-4.7 (Z.AI) causes frequent AI_JSONParseError during streaming. The SSE handler incorrectly concatenates chunks, creating malformed JSON.
Root Cause:
SSE chunks (each prefixed with data: ) are being concatenated instead of parsed separately. The result is {"id":"...data: {"id":"... - an incomplete first JSON object.
Expected:
Split on data: prefix
Parse each chunk as separate JSON
Handle models with reasoning_content
Actual:
Chunks concatenated without parsing, causing parse failure.
Plugins
No response
OpenCode version
1.1.18
Steps to reproduce
Use opencode with GLM-4.7
Run prompts that generate longer responses (multiple chunks)
The core issue appears to be SSE/streaming response handling when models produce multi-chunk responses. Feel free to ignore if your specific SSE concatenation issue differs from these.
Activity
github-actions commentedon Jan 13, 2026
This issue might be a duplicate of existing issues. Please check:
The core issue appears to be SSE/streaming response handling when models produce multi-chunk responses. Feel free to ignore if your specific SSE concatenation issue differs from these.