Merge ticket/ultra-t3: ultra mode with injected guidance and size guideline (#17)
This commit is contained in:
commit
7cf6a3cc2c
7 files changed
+423
-10
No files matched your search
+35
-1
@@ -1,6 +1,13 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
import { readMaxWorkflowItems, readMaxWorkers, readUltraEnabled, readUltraNotify } from "../src/config.ts";
|
||||
import {
|
||||
readMaxWorkflowItems,
|
||||
readMaxWorkers,
|
||||
readUltraEnabled,
|
||||
readUltraGuideline,
|
||||
readUltraMode,
|
||||
readUltraNotify,
|
||||
} from "../src/config.ts";
|
||||
|
||||
test("worker configuration defaults to 16 and accepts only integers from 1 through 32", () => {
|
||||
assert.deepEqual(readMaxWorkers(undefined), { value: 16 });
|
||||
@@ -49,3 +56,30 @@ test("ultra notices default on, disable only on an explicit off, and warn on inv
|
||||
assert.match(result.warning ?? "", /PI_SUBAGENT_ULTRA_NOTIFY/);
|
||||
}
|
||||
});
|
||||
|
||||
test("ultra mode defaults off, accepts on/off, and warns on invalid values", () => {
|
||||
assert.deepEqual(readUltraMode(undefined), { value: false });
|
||||
assert.deepEqual(readUltraMode(""), { value: false });
|
||||
assert.deepEqual(readUltraMode("off"), { value: false });
|
||||
assert.deepEqual(readUltraMode("on"), { value: true });
|
||||
for (const invalid of ["true", "ON", "0", " maybe", "enabled"]) {
|
||||
const result = readUltraMode(invalid);
|
||||
assert.equal(result.value, false);
|
||||
assert.match(result.warning ?? "", /PI_SUBAGENT_ULTRACODE/);
|
||||
assert.match(result.warning ?? "", /using off/);
|
||||
}
|
||||
});
|
||||
|
||||
test("ultra size guideline defaults to medium, accepts the four values, and warns on invalid values", () => {
|
||||
assert.deepEqual(readUltraGuideline(undefined), { value: "medium" });
|
||||
assert.deepEqual(readUltraGuideline(""), { value: "medium" });
|
||||
for (const value of ["small", "medium", "large", "unrestricted"] as const) {
|
||||
assert.deepEqual(readUltraGuideline(value), { value });
|
||||
}
|
||||
for (const invalid of ["tiny", "Medium", "0", " maybe", "huge"]) {
|
||||
const result = readUltraGuideline(invalid);
|
||||
assert.equal(result.value, "medium");
|
||||
assert.match(result.warning ?? "", /PI_SUBAGENT_ULTRA_GUIDELINE/);
|
||||
assert.match(result.warning ?? "", /using medium/);
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user