@@ -33,6 +33,7 @@ export function mkdirSafe(dir: string) {
|
33 | 33 | const fixtureRoot = mkdtempSafe(path.join(os.tmpdir(), "openclaw-plugin-")); |
34 | 34 | let tempDirIndex = 0; |
35 | 35 | const prevBundledDir = process.env.OPENCLAW_BUNDLED_PLUGINS_DIR; |
| 36 | +const prevDisableBundledPlugins = process.env.OPENCLAW_DISABLE_BUNDLED_PLUGINS; |
36 | 37 | const prevPluginStageDir = process.env.OPENCLAW_PLUGIN_STAGE_DIR; |
37 | 38 | |
38 | 39 | export const EMPTY_PLUGIN_SCHEMA = { |
@@ -105,7 +106,8 @@ export function writePlugin(params: {
|
105 | 106 | } |
106 | 107 | |
107 | 108 | export function useNoBundledPlugins() { |
108 | | -process.env.OPENCLAW_BUNDLED_PLUGINS_DIR = "/nonexistent/bundled/plugins"; |
| 109 | +process.env.OPENCLAW_DISABLE_BUNDLED_PLUGINS = "1"; |
| 110 | +delete process.env.OPENCLAW_BUNDLED_PLUGINS_DIR; |
109 | 111 | } |
110 | 112 | |
111 | 113 | export function loadBundleFixture(params: { |
@@ -148,6 +150,11 @@ export function resetPluginLoaderTestStateForTest() {
|
148 | 150 | } else { |
149 | 151 | process.env.OPENCLAW_BUNDLED_PLUGINS_DIR = prevBundledDir; |
150 | 152 | } |
| 153 | +if (prevDisableBundledPlugins === undefined) { |
| 154 | +delete process.env.OPENCLAW_DISABLE_BUNDLED_PLUGINS; |
| 155 | +} else { |
| 156 | +process.env.OPENCLAW_DISABLE_BUNDLED_PLUGINS = prevDisableBundledPlugins; |
| 157 | +} |
151 | 158 | if (prevPluginStageDir === undefined) { |
152 | 159 | delete process.env.OPENCLAW_PLUGIN_STAGE_DIR; |
153 | 160 | } else { |
@@ -161,4 +168,9 @@ export function cleanupPluginLoaderFixturesForTest() {
|
161 | 168 | } catch { |
162 | 169 | // ignore cleanup failures in tests |
163 | 170 | } |
| 171 | +if (prevDisableBundledPlugins === undefined) { |
| 172 | +delete process.env.OPENCLAW_DISABLE_BUNDLED_PLUGINS; |
| 173 | +} else { |
| 174 | +process.env.OPENCLAW_DISABLE_BUNDLED_PLUGINS = prevDisableBundledPlugins; |
| 175 | +} |
164 | 176 | } |