From 1704dceca236e0da3eaad82310d37f6118c48f2a Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Wed, 22 Apr 2026 12:38:38 -0700 Subject: [PATCH] test(skill-workshop): pin disabled hook wiring --- extensions/skill-workshop/index.test.ts | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/extensions/skill-workshop/index.test.ts b/extensions/skill-workshop/index.test.ts index 838fcf95bbc..205b72b8e8a 100644 --- a/extensions/skill-workshop/index.test.ts +++ b/extensions/skill-workshop/index.test.ts @@ -51,6 +51,21 @@ function createProposal( } describe("skill-workshop", () => { + it("does not register hooks or tools when disabled", () => { + const on = vi.fn(); + const registerTool = vi.fn(); + const api = createTestPluginApi({ + pluginConfig: { enabled: false }, + on, + registerTool, + }); + + plugin.register(api); + + expect(registerTool).not.toHaveBeenCalled(); + expect(on).not.toHaveBeenCalled(); + }); + it("detects user corrections and creates an animated GIF proposal", async () => { const workspaceDir = await makeTempDir(); const proposal = createProposalFromMessages({ @@ -198,6 +213,19 @@ describe("skill-workshop", () => { }); }); + it("skips agent_end hook wiring when auto-capture is disabled", () => { + const on = vi.fn(); + const api = createTestPluginApi({ + pluginConfig: { autoCapture: false }, + on, + }); + + plugin.register(api); + + expect(on).toHaveBeenCalledWith("before_prompt_build", expect.any(Function)); + expect(on).not.toHaveBeenCalledWith("agent_end", expect.any(Function)); + }); + it("lets explicit tool suggestions stay pending in auto mode", async () => { const workspaceDir = await makeTempDir(); const stateDir = await makeTempDir();