diff --git a/src/plugins/loader.test-fixtures.ts b/src/plugins/loader.test-fixtures.ts index e692a244133..23edcda9e21 100644 --- a/src/plugins/loader.test-fixtures.ts +++ b/src/plugins/loader.test-fixtures.ts @@ -33,6 +33,7 @@ export function mkdirSafe(dir: string) { const fixtureRoot = mkdtempSafe(path.join(os.tmpdir(), "openclaw-plugin-")); let tempDirIndex = 0; const prevBundledDir = process.env.OPENCLAW_BUNDLED_PLUGINS_DIR; +const prevDisableBundledPlugins = process.env.OPENCLAW_DISABLE_BUNDLED_PLUGINS; const prevPluginStageDir = process.env.OPENCLAW_PLUGIN_STAGE_DIR; export const EMPTY_PLUGIN_SCHEMA = { @@ -105,7 +106,8 @@ export function writePlugin(params: { } export function useNoBundledPlugins() { - process.env.OPENCLAW_BUNDLED_PLUGINS_DIR = "/nonexistent/bundled/plugins"; + process.env.OPENCLAW_DISABLE_BUNDLED_PLUGINS = "1"; + delete process.env.OPENCLAW_BUNDLED_PLUGINS_DIR; } export function loadBundleFixture(params: { @@ -148,6 +150,11 @@ export function resetPluginLoaderTestStateForTest() { } else { process.env.OPENCLAW_BUNDLED_PLUGINS_DIR = prevBundledDir; } + if (prevDisableBundledPlugins === undefined) { + delete process.env.OPENCLAW_DISABLE_BUNDLED_PLUGINS; + } else { + process.env.OPENCLAW_DISABLE_BUNDLED_PLUGINS = prevDisableBundledPlugins; + } if (prevPluginStageDir === undefined) { delete process.env.OPENCLAW_PLUGIN_STAGE_DIR; } else { @@ -161,4 +168,9 @@ export function cleanupPluginLoaderFixturesForTest() { } catch { // ignore cleanup failures in tests } + if (prevDisableBundledPlugins === undefined) { + delete process.env.OPENCLAW_DISABLE_BUNDLED_PLUGINS; + } else { + process.env.OPENCLAW_DISABLE_BUNDLED_PLUGINS = prevDisableBundledPlugins; + } }