fix: unblock unattended research workflows

This commit is contained in:
Advait Paliwal
2026-04-12 13:15:45 -07:00
parent aa96b5ee14
commit 4f6574f233
13 changed files with 117 additions and 12 deletions

View File

@@ -33,6 +33,27 @@ test("patchPiWebAccessSource updates index.ts directory handling", () => {
assert.match(patched, /const dir = dirname\(WEB_SEARCH_CONFIG_PATH\);/);
});
test("patchPiWebAccessSource defaults workflow to none for index.ts", () => {
const input = [
'function resolveWorkflow(input: unknown, hasUI: boolean): WebSearchWorkflow {',
'\tif (!hasUI) return "none";',
'\tif (typeof input === "string" && input.trim().toLowerCase() === "none") return "none";',
'\treturn "summary-review";',
'}',
'workflow: Type.Optional(',
'\tStringEnum(["none", "summary-review"], {',
'\t\tdescription: "Search workflow mode: none = no curator, summary-review = open curator with auto summary draft (default)",',
'\t}),',
'),',
"",
].join("\n");
const patched = patchPiWebAccessSource("index.ts", input);
assert.match(patched, /return "none";/);
assert.doesNotMatch(patched, /summary-review = open curator with auto summary draft \(default\)/);
});
test("patchPiWebAccessSource is idempotent", () => {
const input = [
'import { join } from "node:path";',