无头立项策划默认按五分钟设计目标收口
--plan 之前吃 --task 那条 50 分钟的默认上限,那是做游戏链路的量级。立项策划 的设计目标是五分钟出方案,给一分钟余量;再久就是卡住,早失败比让 harness 空 等更有用。显式 --timeout-minutes 仍然压过默认值,做游戏链路不变。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user