From ac0b08b2ace1dbd9bd303319b51129fdad0b9e6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Tue, 6 Oct 2026 22:56:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=AF=BC=E5=87=BA=E8=A2=AB?= =?UTF-8?q?=E4=BF=A1=E5=8F=B7=E7=BB=88=E6=AD=A2=E6=97=B6=E7=9A=84=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=96=87=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - xhsMinitoolFailure.ts 的 commandFailed 在 exitCode 为 null 时改说「导出中途被中断了」:脚本没启动已归到 exportUnavailable - xhsMinitoolExport.test.tsx 同步这两条措辞断言 --- .../project-development/export/state/xhsMinitoolFailure.ts | 4 +++- apps/ai-game-creator-shell/tests/xhsMinitoolExport.test.tsx | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/ai-game-creator-shell/src/view/project-development/export/state/xhsMinitoolFailure.ts b/apps/ai-game-creator-shell/src/view/project-development/export/state/xhsMinitoolFailure.ts index 8f5196327..88f694346 100644 --- a/apps/ai-game-creator-shell/src/view/project-development/export/state/xhsMinitoolFailure.ts +++ b/apps/ai-game-creator-shell/src/view/project-development/export/state/xhsMinitoolFailure.ts @@ -75,8 +75,10 @@ export function describeXhsMinitoolFailure( case 'commandDenied': return '当前项目的权限设置不允许执行这次导出。'; case 'commandFailed': + // 「脚本根本没启动」已在宿主侧归到 `exportUnavailable`(见 build.rs 的 `script_launched`), + // 所以这里的 `exitCode === null` 只剩「脚本跑起来后被信号终止」:说用户能接住的话,不猜启动。 return error.exitCode === null - ? '导出没能启动,可能是运行环境的问题。' + ? '导出中途被中断了,没能生成代码包。' : '导出中途出错了,没能生成代码包。'; case 'artifactMissing': return '导出跑完了,但没有生成代码包。可以让陶泥儿看看。'; diff --git a/apps/ai-game-creator-shell/tests/xhsMinitoolExport.test.tsx b/apps/ai-game-creator-shell/tests/xhsMinitoolExport.test.tsx index 055cc1290..6be4d79ad 100644 --- a/apps/ai-game-creator-shell/tests/xhsMinitoolExport.test.tsx +++ b/apps/ai-game-creator-shell/tests/xhsMinitoolExport.test.tsx @@ -126,7 +126,7 @@ describe('交给 code agent 的指令', () => { omittedCharacters: 0, }), ).toBe('导出中途出错了,没能生成代码包。'); - // 没启动起来(宿主没给退出码)与跑到一半失败是两句不同的话:用户能做的处置不一样。 + // 没启动起来已经归到 `exportUnavailable`(宿主保证);这里没退出码只剩「被信号终止」这一种。 expect( describeXhsMinitoolFailure({ type: 'commandFailed', @@ -134,7 +134,7 @@ describe('交给 code agent 的指令', () => { outputTail: '', omittedCharacters: 0, }), - ).toBe('导出没能启动,可能是运行环境的问题。'); + ).toBe('导出中途被中断了,没能生成代码包。'); // 策略拒绝是预期拒绝:宿主只给点位,句子在前端,且不进错误池。 expect( describeXhsMinitoolFailure({