From f0b8236258e2c0951099a365fa75a3fc77057767 Mon Sep 17 00:00:00 2001 From: zhb <50901800+zhbdesign@users.noreply.github.com> Date: Sun, 21 Jun 2026 01:08:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=87=E9=A2=98=E7=94=9F=E6=88=90=E6=9C=AA?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE=E8=B0=83=E7=94=A8=E6=A8=A1=E5=9E=8B=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 标题生成未正确调用模型接口 --- src/server/ws/handler.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/server/ws/handler.ts b/src/server/ws/handler.ts index e1e37b6d..4356eb1d 100644 --- a/src/server/ws/handler.ts +++ b/src/server/ws/handler.ts @@ -1047,9 +1047,11 @@ function bindTitleSessionOutput( if (cliMsg?.type === 'result') { conversationService.removeOutputCallback(sessionId, callback) const completedTurnCount = completeActiveTitleTurn(sessionId) - if (!cliMsg.is_error) { - triggerTitleGeneration(ws, sessionId, 'turn-complete', completedTurnCount ?? undefined) - } + // Always attempt AI title generation — even on error turns the user + // message (and partial assistant output) contain enough context for a + // good title. generateTitle is fire-and-forget and returns null on + // any failure, so this is safe. + triggerTitleGeneration(ws, sessionId, 'turn-complete', completedTurnCount ?? undefined) } }