anomalyco / anomalyco/opencode
Zen API SSE streaming splits UTF-8 multi-byte characters causing garbled Chinese in third-party clients
@MrMushrooooom is already working on this.
Since Jul 30, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
When consuming the Zen API (opencode.ai/zen/go/v1/chat/completions) with stream: true, the SSE chunks are too fine-grained, causing UTF-8 multi-byte Chinese characters to be split across chunk boundaries. Clients that process each chunk independently render the incomplete byte sequences as U+FFFD replacement characters (��).
Plugins
No response
OpenCode version
No response
Steps to reproduce
1.Connect any OpenAI-compatible client (tested: WorkBuddy, curl) to https://opencode.ai/zen/go/v1/chat/completions
2.Send a Chinese prompt with "stream": true using deepseek-v4-flash
3.Observe the rendered response — Chinese characters intermittently display as ��
Example: "修复方法" appears as "��复方法" (first byte E4 of 修 is lost at chunk boundary).
Screenshot and/or share link
No response
Operating System
Windows 11
Terminal
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.