From af1fc63de287160e4755dd5895e03dd5b056d8db Mon Sep 17 00:00:00 2001 From: Linghong Date: Thu, 20 Aug 2026 05:38:14 +0000 Subject: [PATCH] =?UTF-8?q?=E6=97=A0=E5=A4=B4=E7=AB=8B=E9=A1=B9=E7=AD=96?= =?UTF-8?q?=E5=88=92=E9=BB=98=E8=AE=A4=E6=8C=89=E4=BA=94=E5=88=86=E9=92=9F?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E7=9B=AE=E6=A0=87=E6=94=B6=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --plan 之前吃 --task 那条 50 分钟的默认上限,那是做游戏链路的量级。立项策划 的设计目标是五分钟出方案,给一分钟余量;再久就是卡住,早失败比让 harness 空 等更有用。显式 --timeout-minutes 仍然压过默认值,做游戏链路不变。 Co-Authored-By: Claude Opus 5 --- .../scripts/agent-swarm-test-chat.mjs | 8 +++++-- .../tests/agentSwarmTestEntry.test.ts | 22 +++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/apps/ai-game-creator-shell/scripts/agent-swarm-test-chat.mjs b/apps/ai-game-creator-shell/scripts/agent-swarm-test-chat.mjs index 246cc297a..fa10ae383 100644 --- a/apps/ai-game-creator-shell/scripts/agent-swarm-test-chat.mjs +++ b/apps/ai-game-creator-shell/scripts/agent-swarm-test-chat.mjs @@ -141,7 +141,7 @@ export const usage = `用法: --no-open 手工模式启动预览但不自动打开浏览器 --task <需求> 通过 manual 入口非交互提交自定义需求 --plan 走「做方案」立项策划入口,不做游戏,不做产物验收和试玩 - --timeout-minutes <分钟> 设置本次执行期限;自动任务默认 50 分钟,手工模式默认不限时 + --timeout-minutes <分钟> 设置本次执行期限;自动任务默认 50 分钟,--plan 默认 6 分钟,手工模式默认不限时 --dry-run 只检查目录发现和项目准备,不启动 LLM -h, --help 显示帮助`; @@ -222,7 +222,11 @@ export function shouldStartPersistentPreview(options) { } export function resolveSwarmTestTimeoutMs(options) { - const minutes = options.timeoutMinutes ?? (options.task ? 50 : null); + // 立项策划的设计目标是五分钟出方案,给一分钟余量;再久就是卡住了,早失败 + // 比让 harness 空等更有用。做游戏那条链路的 50 分钟不变。 + const planMinutes = options.plan ? 6 : null; + const minutes = + options.timeoutMinutes ?? planMinutes ?? (options.task ? 50 : null); return minutes === null ? null : minutes * 60_000; } diff --git a/apps/ai-game-creator-shell/tests/agentSwarmTestEntry.test.ts b/apps/ai-game-creator-shell/tests/agentSwarmTestEntry.test.ts index f06404855..be8b984fc 100644 --- a/apps/ai-game-creator-shell/tests/agentSwarmTestEntry.test.ts +++ b/apps/ai-game-creator-shell/tests/agentSwarmTestEntry.test.ts @@ -730,6 +730,28 @@ describe('Swarm test argument parsing', () => { ).toBe(false); }); + it('bounds the plan lane to its own five-minute design target', () => { + // 交互模式也要有上限:立项策划没有可试玩产物可等,卡住就该早失败。 + expect(resolveSwarmTestTimeoutMs(parseSwarmTestArguments(['--plan']))).toBe( + 6 * 60_000, + ); + expect( + resolveSwarmTestTimeoutMs( + parseSwarmTestArguments([ + '--plan', + '--task', + '做一个解谜游戏的立项方案', + ]), + ), + ).toBe(6 * 60_000); + // 显式 --timeout-minutes 仍然压过默认值。 + expect( + resolveSwarmTestTimeoutMs( + parseSwarmTestArguments(['--plan', '--timeout-minutes', '20']), + ), + ).toBe(20 * 60_000); + }); + it('applies a bounded default only to non-interactive tasks', () => { expect(resolveSwarmTestTimeoutMs(parseSwarmTestArguments([]))).toBeNull(); expect(