fix(hooks): skip skill workshop capture when review is off

This commit is contained in:
Vincent Koc
2026-04-22 12:40:38 -07:00
parent 8fcca8a5e1
commit e71da6705b
2 changed files with 14 additions and 1 deletions

View File

@@ -226,6 +226,19 @@ describe("skill-workshop", () => {
expect(on).not.toHaveBeenCalledWith("agent_end", expect.any(Function));
});
it("skips agent_end hook wiring when review mode is off", () => {
const on = vi.fn();
const api = createTestPluginApi({
pluginConfig: { reviewMode: "off" },
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();

View File

@@ -25,7 +25,7 @@ export default definePluginEntry({
prependSystemContext: buildWorkshopGuidance(config),
}));
if (config.autoCapture) {
if (config.autoCapture && config.reviewMode !== "off") {
api.on("agent_end", async (event, ctx) => {
if (!event.success) {
return;