Skip to content

Commit b0a36a1

Browse files
test(provider): fail when max-turns is below 30
1 parent e22cb86 commit b0a36a1

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

global-template/docgen/test/fixtures/fake-provider.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
import fs from 'node:fs';
33
import path from 'node:path';
44

5+
const maxTurnsIndex = process.argv.indexOf('--max-turns');
6+
const maxTurns = maxTurnsIndex >= 0 ? Number(process.argv[maxTurnsIndex + 1]) : 0;
7+
if (!Number.isFinite(maxTurns) || maxTurns < 30) {
8+
console.error(`Warning: Reached maximum conversation turns (${maxTurns || 'missing'}). Retry with --max-turns 30.`);
9+
process.exit(8);
10+
}
11+
512
const prompt = fs.readFileSync(0, 'utf8');
613
const stage = process.env.DOCGEN_STAGE;
714
const cwd = process.cwd();

0 commit comments

Comments
 (0)