Skip to content

Commit ad30017

Browse files
committed
addressing codex review
1 parent e87f20d commit ad30017

3 files changed

Lines changed: 14 additions & 11 deletions

File tree

extensions/skill-workshop/index.test.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ describe("skill-workshop", () => {
617617
expect(await store.list("pending")).toHaveLength(1);
618618
});
619619

620-
it("keeps explicit tool suggestions pending when pending mode receives apply true", async () => {
620+
it("queues apply true suggestions in pending mode before explicit apply", async () => {
621621
const workspaceDir = await makeTempDir();
622622
const stateDir = await makeTempDir();
623623
let tool: AnyAgentTool | undefined;
@@ -651,18 +651,24 @@ describe("skill-workshop", () => {
651651
const proposalId =
652652
(result?.details as { proposal?: { id?: string } } | undefined)?.proposal?.id ?? "";
653653
expect(proposalId).toBeTruthy();
654-
await expect(
655-
tool?.execute?.("call-2", {
656-
action: "apply",
657-
id: proposalId,
658-
}),
659-
).rejects.toThrow("tool apply requires auto approval policy");
660654
await expect(
661655
fs.access(path.join(workspaceDir, "skills", "screenshot-asset-workflow", "SKILL.md")),
662656
).rejects.toMatchObject({ code: "ENOENT" });
663657
const store = new SkillWorkshopStore({ stateDir, workspaceDir });
664658
expect(await store.list("pending")).toHaveLength(1);
665659
expect(await store.list("applied")).toHaveLength(0);
660+
661+
const applied = await tool?.execute?.("call-2", {
662+
action: "apply",
663+
id: proposalId,
664+
});
665+
666+
expect(applied?.details).toMatchObject({ status: "applied" });
667+
await expect(
668+
fs.access(path.join(workspaceDir, "skills", "screenshot-asset-workflow", "SKILL.md")),
669+
).resolves.toBeUndefined();
670+
expect(await store.list("pending")).toHaveLength(0);
671+
expect(await store.list("applied")).toHaveLength(1);
666672
});
667673

668674
it("uses the reviewer to propose existing skill repairs", async () => {

extensions/skill-workshop/src/prompt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export function buildWorkshopGuidance(config: SkillWorkshopConfig): string {
44
const writeMode =
55
config.approvalPolicy === "auto"
66
? "Auto mode: apply safe workspace-skill updates; apply=false queues instead."
7-
: "Pending mode: queue suggestions for review; tool calls cannot apply them.";
7+
: "Pending mode: queue suggestions; use apply action after explicit approval.";
88
return [
99
"<skill_workshop>",
1010
"Use for durable procedural memory, not facts/preferences.",

extensions/skill-workshop/src/tool.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,6 @@ export function createSkillWorkshopTool(params: {
155155
return jsonResult(result);
156156
}
157157
if (action === "apply") {
158-
if (params.config.approvalPolicy !== "auto") {
159-
throw new Error("tool apply requires auto approval policy");
160-
}
161158
if (!raw.id) {
162159
throw new Error("id required");
163160
}

0 commit comments

Comments
 (0)