fix: tighten workflow prompts and search defaults
This commit is contained in:
@@ -33,13 +33,15 @@ 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", () => {
|
||||
test("patchPiWebAccessSource defaults workflow to none for index.ts without disabling explicit summary-review", () => {
|
||||
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";',
|
||||
'}',
|
||||
'const configWorkflow = loadConfigForExtensionInit().workflow;',
|
||||
'const workflow = resolveWorkflow(params.workflow ?? configWorkflow, ctx?.hasUI !== false);',
|
||||
'workflow: Type.Optional(',
|
||||
'\tStringEnum(["none", "summary-review"], {',
|
||||
'\t\tdescription: "Search workflow mode: none = no curator, summary-review = open curator with auto summary draft (default)",',
|
||||
@@ -50,8 +52,9 @@ test("patchPiWebAccessSource defaults workflow to none for index.ts", () => {
|
||||
|
||||
const patched = patchPiWebAccessSource("index.ts", input);
|
||||
|
||||
assert.match(patched, /return "none";/);
|
||||
assert.doesNotMatch(patched, /summary-review = open curator with auto summary draft \(default\)/);
|
||||
assert.match(patched, /params\.workflow \?\? configWorkflow \?\? "none"/);
|
||||
assert.match(patched, /return "summary-review";/);
|
||||
assert.match(patched, /summary-review = open curator with auto summary draft \(opt-in\)/);
|
||||
});
|
||||
|
||||
test("patchPiWebAccessSource is idempotent", () => {
|
||||
|
||||
Reference in New Issue
Block a user