opencode bug: SSE size guard rejects valid events based on stream chunking

521ox · ghdev · 2026-10-18

Issue #56707 (confirmed reproduced) in anomalyco/opencode: the generated Promise client's SSE size guard checks the accumulated decoded buffer before consuming complete frames. As a result, two individually valid SSE events can fail with SseEventTooLarge when delivered in one ReadableStream chunk, while the identical bytes succeed with smaller chunks.

The reporter reproduced it with two session.reasoning.ended frames carrying 8,388,608 repeated ASCII characters each (8,388,783 decoded characters per frame, under the 16MB limit): concatenated as one chunk (16,777,566 characters total) they fail, split into 64 KiB chunks they pass. The author frames this as a narrow parser issue related to #36441/#36444, explicitly not a request to remove or raise the limit introduced in #36442. Environment: locally built fork based on official commit 63c1a27a (opencode 2.0.32-custom-lite.20261018.1), Windows 11, Bun 1.4.2.

Original post →

More from coding & agent

coding & agent channel →