From 1ba9ac848fe5fcd183d93411908b9d88c862268b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Fri, 2 Oct 2026 22:31:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E5=9B=9E=E5=90=88?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E8=BD=BD=E8=8D=B7=E7=BC=BA=20kind=20?= =?UTF-8?q?=E6=97=B6=E4=B8=8D=E5=86=8D=E8=AE=A9=E5=A4=B1=E8=B4=A5=E6=96=87?= =?UTF-8?q?=E6=A1=88=E6=8A=9B=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - turn.completed.failure 跨 IPC 没有运行时校验,modelCallFailed 载荷缺 kind 时 directModelCallText 会解引用 undefined 抛错,整个事件订阅被打断 - directModelCallText 参数放宽为 ModelCallKind | null | undefined,缺分类时回落到通用句"智能服务执行失败,请稍后重试" --- .../chat/conversation/directTurnFailure.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/ai-game-creator-shell/src/view/project-development/chat/conversation/directTurnFailure.ts b/apps/ai-game-creator-shell/src/view/project-development/chat/conversation/directTurnFailure.ts index 05e1da13a..e47b1a4ac 100644 --- a/apps/ai-game-creator-shell/src/view/project-development/chat/conversation/directTurnFailure.ts +++ b/apps/ai-game-creator-shell/src/view/project-development/chat/conversation/directTurnFailure.ts @@ -76,7 +76,11 @@ function directNativeKindText(kind: NativeKind): string { } /** 模型调用失败的可见说明:有原生分类看原生分类,没有就看平台层那一层的分类。 */ -function directModelCallText(kind: ModelCallKind): string { +function directModelCallText(kind: ModelCallKind | null | undefined): string { + // 载荷跨 IPC 没有运行时校验:`kind` 缺失时按"没有分类"兜底,别让整条事件订阅在这一步抛错。 + if (!kind) { + return '智能服务执行失败,请稍后重试'; + } switch (kind.type) { case 'responseTimedOut': return '等待模型回执超时,本轮未完成;请稍后重试';