From 06121c9b10b6eb31c3425ef86f04b40a9ad2688e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E5=A4=952077?= Date: Tue, 3 Feb 2026 21:54:46 +0800 Subject: [PATCH 1/2] Update VERSION --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 80803fa..d578041 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.8.8 +2.8.9 From 6170666ff3f5c90816814dd8346798974a9e2590 Mon Sep 17 00:00:00 2001 From: Jie Ma Date: Wed, 4 Feb 2026 13:42:28 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9F=90=E4=BA=9B?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E7=AB=AF=E6=B2=A1=E6=9C=89=E6=8E=A5=E6=94=B6?= =?UTF-8?q?=E5=88=B0=E6=B5=81=E7=BB=93=E6=9D=9F=E4=BF=A1=E6=81=AF=E5=90=8E?= =?UTF-8?q?=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/common.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/utils/common.js b/src/utils/common.js index 4d65d28..ccbde75 100644 --- a/src/utils/common.js +++ b/src/utils/common.js @@ -491,6 +491,17 @@ export async function handleStreamRequest(res, service, model, requestBody, from responseClosed = true; } finally { if (!responseClosed) { + // 根据客户端协议发送相应的流式结束标记 + const clientProtocol = getProtocolPrefix(fromProvider); + if (clientProtocol === MODEL_PROTOCOL_PREFIX.OPENAI) { + res.write('data: [DONE]\n\n'); + } else if (clientProtocol === MODEL_PROTOCOL_PREFIX.OPENAI_RESPONSES) { + res.write('event: done\n'); + res.write('data: {}\n\n'); + } else if (clientProtocol === MODEL_PROTOCOL_PREFIX.CLAUDE) { + res.write('event: message_stop\n'); + res.write('data: {"type":"message_stop"}\n\n'); + } res.end(); } await logConversation('output', fullResponseText, PROMPT_LOG_MODE, PROMPT_LOG_FILENAME);