diff --git a/core/llm/stream.ts b/core/llm/stream.ts index 0a014d931..78a4b60e3 100644 --- a/core/llm/stream.ts +++ b/core/llm/stream.ts @@ -58,7 +58,7 @@ function parseDataLine(line: string): any { } function parseSseLine(line: string): { done: boolean; data: any } { - if (line.startsWith("data: [DONE]")) { + if (line.startsWith("data:[DONE]") || line.startsWith("data: [DONE]")) { return { done: true, data: undefined }; } if (line.startsWith("data:")) {