Summary
When an AI chat UI stops mid-sentence with ERR_INCOMPLETE_CHUNKED_ENCODING, net::ERR_CONNECTION_RESET, or a truncated Server-Sent Events (text/event-stream) stream, the LLM usually did not crash—a proxy, CDN, or serverless timeout cut the connection before [DONE] arrived.
If you want this resolved without guesswork, SazM fixes broken LLM streaming pipelines for a fixed $99, delivered within 48 hours, 100% in writing with zero calls. See our AI integration services or request the $99 fix.
1. Proxy Buffering & Idle Timeouts
Nginx, Apache, and load balancers buffer responses by default or drop idle connections after 30–60 seconds:
- Nginx: Set
proxy_buffering off;,proxy_cache off;, andX-Accel-Buffering: noon the streaming route so chunks flush immediately. - Reverse-proxy timeouts: Increase
proxy_read_timeoutif the model pauses between reasoning tokens or tool calls.
2. Serverless & Edge Execution Limits
In serverless functions or Workers, returning a ReadableStream without keeping the stream open or exceeding wall-clock limits truncates the SSE payload mid-JSON.
- Pipe the upstream
response.bodydirectly instead of awaiting the full completion. - Send periodic SSE heartbeat comments (
: keepalive\n\n) during long tool-call steps so intermediate proxies do not close the socket.
Need It Fixed?
We debug production OpenAI, Anthropic, and Cloudflare Workers AI streaming pipelines—plus our 5-tool MCP server (sazm.in/mcp)—for a fixed $99 within 48 hours, verified before you pay and 100% async. Start your $99 fix or explore our AI integration services.