From 2ce96a73f03455649ec2f272907b86f82d956808 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Thu, 24 Sep 2026 14:48:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E7=AB=AF=EF=BC=9A=E6=8B=92=E5=8D=95?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E7=9A=84=E7=A9=BA=E6=96=87=E6=A1=88=E4=B8=8D?= =?UTF-8?q?=E5=86=8D=E8=BF=94=E5=9B=9E=E7=A9=BA=E4=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - `directTurnRejectionNotice` 认得的拒单在宿主文案为空白时返回 `null`,不再返回空串:`''` 显示不出任何提示,却会被按 `!== null` 判据的调用方当成"有提示" - 补注释把"有提示"的判据说清:要么给一条能显示的话,要么给 `null` --- .../chat/conversation/directCodexConversation.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/ai-game-creator-shell/src/view/project-development/chat/conversation/directCodexConversation.ts b/apps/ai-game-creator-shell/src/view/project-development/chat/conversation/directCodexConversation.ts index 2d662afe9..0285a1692 100644 --- a/apps/ai-game-creator-shell/src/view/project-development/chat/conversation/directCodexConversation.ts +++ b/apps/ai-game-creator-shell/src/view/project-development/chat/conversation/directCodexConversation.ts @@ -91,6 +91,10 @@ export function readDirectTurnRejection( * * 名单只放"用户自己就能改、且不需要宿主诊断"的变体:`environmentNotReady` / * `hostStateUnavailable` 这类是宿主 / 环境事实,必须走上报通道,所以不在这里。 + * + * 空文案按"没有提示"处理:这个函数要么给一条能显示的话,要么给 `null`——宿主给不出可展示的文案 + * 时返回 `null`,而不是让调用方拿到一条空串(`''` 显示不出任何东西,却会被按 `!== null` 判据的 + * 调用方当成"有提示")。 */ export function directTurnRejectionNotice( rejection: DirectTurnRejection, @@ -104,7 +108,7 @@ export function directTurnRejectionNotice( case 'permissionRejected': case 'inputRejected': case 'contentEmpty': - return rejection.message.trim(); + return rejection.message.trim() || null; default: return null; }