Add workflow item cap environment configuration

This commit is contained in:
alex committed 2026-11-26 17:58:17 +00:00
1 parent f644224eb0
commit 7753d6778a
2 files changed
+35 -1

No files matched your search

+14 -1
View File
@@ -1,6 +1,6 @@
import assert from "node:assert/strict";
import test from "node:test";
import { readMaxWorkers } from "../src/config.ts";
import { readMaxWorkflowItems, readMaxWorkers } from "../src/config.ts";
test("worker configuration accepts only integers from 1 through 32", () => {
assert.deepEqual(readMaxWorkers(undefined), { value: 4 });
@@ -12,3 +12,16 @@ test("worker configuration accepts only integers from 1 through 32", () => {
assert.match(result.warning ?? "", /PI_SUBAGENT_MAX_WORKERS/);
}
});
test("workflow item configuration defaults to 32 and accepts only integers from 1 through 256", () => {
assert.deepEqual(readMaxWorkflowItems(undefined), { value: 32 });
assert.deepEqual(readMaxWorkflowItems(""), { value: 32 });
assert.deepEqual(readMaxWorkflowItems("1"), { value: 1 });
assert.deepEqual(readMaxWorkflowItems("32"), { value: 32 });
assert.deepEqual(readMaxWorkflowItems("256"), { value: 256 });
for (const invalid of ["0", "257", "-1", "2.5", "many", " 4"]) {
const result = readMaxWorkflowItems(invalid);
assert.equal(result.value, 32);
assert.match(result.warning ?? "", /PI_SUBAGENT_WORKFLOW_MAX_ITEMS/);
}
});