Merge pull request #3563 from Tibsfox/fix/headless-discuss-multi-turn
fix(headless): treat discuss and plan as multi-turn commands
This commit is contained in:
commit
42caabdd0d
2 changed files with 22 additions and 1 deletions
|
|
@ -259,7 +259,9 @@ async function runHeadlessOnce(options: HeadlessOptions, restartCount: number):
|
|||
// per-unit timeout via auto-supervisor. Disable the overall timeout unless the
|
||||
// user explicitly set --timeout.
|
||||
const isAutoMode = options.command === 'auto'
|
||||
const isMultiTurnCommand = options.command === 'auto' || options.command === 'next'
|
||||
// discuss and plan are multi-turn: they involve multiple question rounds,
|
||||
// codebase scanning, and artifact writing before the workflow completes (#3547).
|
||||
const isMultiTurnCommand = options.command === 'auto' || options.command === 'next' || options.command === 'discuss' || options.command === 'plan'
|
||||
if (isAutoMode && options.timeout === 300_000) {
|
||||
options.timeout = 0
|
||||
}
|
||||
|
|
|
|||
19
src/tests/headless-multi-turn.test.ts
Normal file
19
src/tests/headless-multi-turn.test.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Regression test for #3547: discuss and plan must be classified as
|
||||
* multi-turn commands in headless mode.
|
||||
*/
|
||||
import { test } from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { join, dirname } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
test("headless.ts classifies discuss as multi-turn (#3547)", () => {
|
||||
const src = readFileSync(join(__dirname, "..", "headless.ts"), "utf-8");
|
||||
const multiTurnLine = src.match(/isMultiTurnCommand\s*=\s*[^;]+/);
|
||||
assert.ok(multiTurnLine, "isMultiTurnCommand must be defined");
|
||||
assert.ok(multiTurnLine![0].includes("discuss"), "discuss must be in multi-turn list");
|
||||
assert.ok(multiTurnLine![0].includes("plan"), "plan must be in multi-turn list");
|
||||
});
|
||||
Loading…
Add table
Reference in a new issue