mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 16:30:57 +00:00
fix(hooks): skip skill workshop capture when review is off
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user