Offer the Subagents switch on five more skills

AI Assisted
This commit is contained in:
jparkerweb committed 2026-11-02 13:13:31 -08:00
1 parent ef4d86258b
commit d7abcd2ac6
16 files changed
+99 -30

No files matched your search

+6 -6
View File
@@ -2018,18 +2018,18 @@ test("workspace cursor never moves backwards, and only changes past it are pendi
}
});
test("subagents: only the seven opted-in workflows offer the switch", () => {
for (const w of ["implement", "implement-review", "quick-task", "review", "pathfinder", "plan", "revise-plan"]) {
test("subagents: only the twelve opted-in workflows offer the switch", () => {
for (const w of ["init", "init-update", "pathfinder", "plan", "revise-plan", "document", "implement", "implement-review", "quick-task", "review", "xray", "diagnose"]) {
assert.equal(offered(w), true, w);
assert.ok(defaultInstruction(w).length > 0, `${w} has a default instruction`);
}
for (const w of ["dashboard", "document", "finalize", "init", "handoff", "constructor", "toString", undefined]) {
for (const w of ["dashboard", "finalize", "changelog", "git", "handoff", "constructor", "toString", undefined]) {
assert.equal(offered(w), false, String(w));
assert.equal(defaultInstruction(w), "");
}
assert.equal(Object.keys(SUBAGENT_WORKFLOWS).length, 7);
assert.equal(Object.keys(SUBAGENT_WORKFLOWS).length, 12);
assert.deepEqual(defaultSetting("review"), { workflow: "review", on: true, instruction: null, max: 3, strength: "balanced" });
assert.equal(defaultSetting("document").on, false, "a skill without the switch is never on");
assert.equal(defaultSetting("changelog").on, false, "a skill without the switch is never on");
assert.equal(effectiveInstruction({ workflow: "review", instruction: " " }), defaultInstruction("review"));
assert.equal(effectiveInstruction({ workflow: "review", instruction: " Mine " }), "Mine");
});
@@ -2069,7 +2069,7 @@ test("subagents: blockFor walks every switch transition, and never says off to a
assert.equal(blockFor(setting(true, 6), none).lines[0], line("balanced", 3), "a reset cursor re-states on");
assert.equal(blockFor(setting(false, 6), none), null, "a reset cursor with it off: nothing");
assert.equal(blockFor({ ...setting(true, 9), workflow: "document" }, none), null, "a workflow that does not offer it: nothing");
assert.equal(blockFor({ ...setting(true, 9), workflow: "changelog" }, none), null, "a workflow that does not offer it: nothing");
});
test("subagents: the injected wording names no harness tool", () => {
+6 -1
View File
@@ -383,7 +383,7 @@ test("Implement's card launches Implement + Review when Review is ticked", () =>
assert.equal(launchVariant(quick, true), quick, "a card with no Review box is unchanged");
});
test("helper-strength.md ships in the seven skills that start helpers, and in no other", () => {
test("helper-strength.md ships in the twelve skills that start helpers, and in no other", () => {
// npm test has just built skills/; a direct run builds it so the check never reads a stale tree.
if (process.env.npm_lifecycle_event !== "test") {
execFileSync(process.execPath, [path.join(ROOT, "install.js"), "--build-skills"], { stdio: "ignore" });
@@ -394,10 +394,15 @@ test("helper-strength.md ships in the seven skills that start helpers, and in no
"plan2code-0-pathfinder",
"plan2code-1-plan",
"plan2code-1b-revise-plan",
"plan2code-2-document",
"plan2code-3-implement",
"plan2code-3-implement-review",
"plan2code-diagnose",
"plan2code-init",
"plan2code-init-update",
"plan2code-quick-task",
"plan2code-review",
"plan2code-xray",
]);
});
+20 -5
View File
@@ -241,12 +241,12 @@ test("subagents: a save that matches this session still becomes the project's se
});
test("subagents: a workflow without the switch refuses it, bad bodies name the field, and an older copy's open hides it", async () => {
const doc = subagentsSession({ workflow: "document" });
const plain = subagentsSession({ workflow: "changelog" });
const s = subagentsSession();
try {
assert.deepEqual(await setSubagents(doc, ON3), { status: 400, body: { error: "not-offered" } });
assert.equal((await frameSubagents(doc)).offered, false);
assert.equal("subagents" in (await submitAndWait(doc)).json, false);
assert.deepEqual(await setSubagents(plain, ON3), { status: 400, body: { error: "not-offered" } });
assert.equal((await frameSubagents(plain)).offered, false);
assert.equal("subagents" in (await submitAndWait(plain)).json, false);
assert.deepEqual(await setSubagents(s, { ...ON3, max: 0 }), { status: 400, body: { error: "max" } });
assert.deepEqual(await setSubagents(s, { ...ON3, max: 21 }), { status: 400, body: { error: "max" } });
@@ -266,7 +266,22 @@ test("subagents: a workflow without the switch refuses it, bad bodies name the f
fs.rmSync(path.join(s.session, "subagents-setting.json"), { force: true });
assert.equal("subagents" in (await submitAndWait(s)).json, false);
} finally {
cli(["stop", "--session", doc.sid, "--force"]);
cli(["stop", "--session", plain.sid, "--force"]);
cli(["stop", "--session", s.sid, "--force"]);
}
});
test("subagents: a newly opted-in workflow offers the switch end to end", async () => {
const s = subagentsSession({ workflow: "xray" });
try {
assert.equal(offered("xray"), true, "skills.js opts xray in");
assert.ok(defaultInstruction("xray").length > 0, "and ships its instruction");
const frame = await frameSubagents(s);
assert.equal(frame.offered, true, "the session's frame offers the switch");
const on = await setSubagents(s, ON3);
assert.equal(on.status, 200, "the route accepts the save");
assert.equal(on.body.setting.workflow, "xray");
} finally {
cli(["stop", "--session", s.sid, "--force"]);
}
});