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 '等待模型回执超时,本轮未完成;请稍后重试';