From 15fd465a4829fde352c7c7e2003b71d2acc270b3 Mon Sep 17 00:00:00 2001 From: Tak Hoffman <781889+Takhoffman@users.noreply.github.com> Date: Thu, 19 Mar 2026 00:09:18 -0500 Subject: [PATCH] Isolate plugin hook tests from plugin caches --- src/hooks/plugin-hooks.test.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/hooks/plugin-hooks.test.ts b/src/hooks/plugin-hooks.test.ts index 333c3a3cf39..29c1127d67e 100644 --- a/src/hooks/plugin-hooks.test.ts +++ b/src/hooks/plugin-hooks.test.ts @@ -4,6 +4,8 @@ import os from "node:os"; import path from "node:path"; import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; import type { OpenClawConfig } from "../config/config.js"; +import { clearPluginDiscoveryCache } from "../plugins/discovery.js"; +import { clearPluginManifestRegistryCache } from "../plugins/manifest-registry.js"; import { clearInternalHooks, createInternalHookEvent, @@ -24,6 +26,8 @@ describe("bundle plugin hooks", () => { beforeEach(async () => { clearInternalHooks(); + clearPluginDiscoveryCache(); + clearPluginManifestRegistryCache(); workspaceDir = path.join(fixtureRoot, `case-${caseId++}`); await fsp.mkdir(workspaceDir, { recursive: true }); previousBundledHooksDir = process.env.OPENCLAW_BUNDLED_HOOKS_DIR; @@ -32,6 +36,8 @@ describe("bundle plugin hooks", () => { afterEach(() => { clearInternalHooks(); + clearPluginDiscoveryCache(); + clearPluginManifestRegistryCache(); if (previousBundledHooksDir === undefined) { delete process.env.OPENCLAW_BUNDLED_HOOKS_DIR; } else {