Dashboardopencode-lorelooksLikeSSE headerless detection

looksLikeSSE headerless detection

Category: gotcha
Confidence: 1.00
ID: 01a0a797-9dff-77ab-b51b-d6235c000e5b
Project ID: 6f4be9ff-ed84-4cca-a9e7-732a0b0b8677
Cross-project: No
Recalled in other projects: 0
Source session: 0c4mriludrAu4Oy6P
Created: 2026-09-16 00:22:06
Updated: 2026-09-16 00:22:06

Content

Trap: trusting only Content-Type: text/event-stream looks standards-compliant, but ChatGPT/Copilot/Codex and DeepSeek may return SSE without that header, causing JSON parse failures such as LOREAI-GATEWAY-38. Fix: looksLikeSSE() removes one BOM, trims leading whitespace, and recognizes legal data:, event:, id:, retry:, or comment prefixes while preserving {/[ JSON handling.

Move to: