From d6098cbe8464b9f825c10cd37aa04c8c4f6c965d Mon Sep 17 00:00:00 2001 From: RECTOR Date: Mon, 27 Jul 2026 13:49:36 +0700 Subject: [PATCH] =?UTF-8?q?fix(engine):=20raise=20DEFAULT=5FMAX=5FTURNS=20?= =?UTF-8?q?20=20=E2=86=92=201000=20(effectively=20uncapped=20for=20normal?= =?UTF-8?q?=20work)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 20-turn default clipped legit complex tasks (read a large file + plan + implement + test + commit routinely needs 30-60 turns) — dogfooding SPEC-6-1, Tasks 5/6/10 all hit it. 1000 is effectively uncapped for normal work (very complex multi-file tasks rarely exceed ~100 turns) while bounding runaway loops. Matches the Claude Code Task-tool experience (no tight per-task turn cap). The maxTurns param (v0.9.3) stays for callers who want a tight cap (e.g. 5 for a trivial lookup). --- package.json | 2 +- src/engine/turn-budget.ts | 5 ++++- test/turn-budget.test.mts | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 24e7b4b..65cce02 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getpipher/armory-fleet", - "version": "0.9.3", + "version": "0.9.4", "private": false, "description": "The armory suite's subagent orchestrator for the pi coding agent \u2014 a cross-harness, superpowers-native fleet where every agent is armory-native from birth.", "license": "MIT", diff --git a/src/engine/turn-budget.ts b/src/engine/turn-budget.ts index cbbc54e..84fd1ac 100644 --- a/src/engine/turn-budget.ts +++ b/src/engine/turn-budget.ts @@ -1,5 +1,8 @@ // src/engine/turn-budget.ts -export const DEFAULT_MAX_TURNS = 20; +/** Default per-run turn budget. Effectively uncapped for normal work — a very complex + * multi-file task rarely exceeds ~100 turns; 1000 bounds runaway loops while never clipping + * legit work. Callers may pass a tighter `maxTurns` (e.g. 5) for trivial lookups. (v0.9.4: was 20.) */ +export const DEFAULT_MAX_TURNS = 1000; export interface TurnBudget { /** Returns true when the just-consumed turn meets/exceeds the cap. */ diff --git a/test/turn-budget.test.mts b/test/turn-budget.test.mts index f31713f..5b44204 100644 --- a/test/turn-budget.test.mts +++ b/test/turn-budget.test.mts @@ -17,8 +17,8 @@ test("exhausted at max", () => { strictEqual(b.count(), 2); }); -test("default max is 20", () => { +test("default max is 1000 (v0.9.4: effectively uncapped for normal work)", () => { const b = createTurnBudget(); - for (let i = 0; i < 19; i++) ok(!b.consume(), `turn ${i + 1} not exhausted`); + for (let i = 0; i < 999; i++) ok(!b.consume(), `turn ${i + 1} not exhausted`); strictEqual(b.consume(), true); }); \ No newline at end of file