deepseek-ai/deepseek-harness · error · LlmError
STREAM_CLOSED
STREAM_CLOSED
Error message
SSE stream ended without [DONE]
What it means
Error "SSE stream ended without [DONE]" thrown in deepseek-ai/deepseek-harness.
Source
Thrown at packages/llm/llm-deepseek/src/sse.ts:39
* Parse an SSE byte stream into data payloads. Yields `[DONE]` as the final
* value and returns; throws `LlmError('STREAM_CLOSED')` when the stream ends
* without it (truncated response — the model call cannot be trusted).
* @param stream - raw SSE bytes; reads may split anywhere, including mid-UTF-8 sequence.
* @param onComment - optional transport-activity callback; comments never enter the yielded payload stream.
* @returns each event's data payload in arrival order, the `[DONE]` sentinel last.
*/
export async function* parseSse(
stream: ReadableStream<BufferSource>,
onComment?: (comment: string) => void,
): AsyncGenerator<string> {
const events = stream
.pipeThrough(new TextDecoderStream())
.pipeThrough(new EventSourceParserStream({ onComment }))
for await (const { data } of events) {
yield data
if (data === DONE) return
}
throw new LlmError('SSE stream ended without [DONE]', 'STREAM_CLOSED')
}
View on GitHub (pinned to b150a551b8)
Solutions
- Retry the request; the SSE connection ended before the [DONE] marker.
When it happens
Trigger: Thrown at packages/llm/llm-deepseek/src/sse.ts:39 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24).
Data as JSON: /api/errors/c565ce7e6e66ab48.
Report an issue: GitHub.