
















@@ -10,6 +10,15 @@ import {
1010mkdirSafeDir,
1111} from "./test-helpers/fs-fixtures.js";
121213+vi.mock("./bundled-dir.js", async (importOriginal) => {
14+const actual = await importOriginal<typeof import("./bundled-dir.js")>();
15+return {
16+ ...actual,
17+resolveBundledPluginsDir: (env: NodeJS.ProcessEnv = process.env) =>
18+env.OPENCLAW_BUNDLED_PLUGINS_DIR ?? actual.resolveBundledPluginsDir(env),
19+};
20+});
21+1322const tempDirs: string[] = [];
14231524function makeTempDir() {
@@ -58,6 +67,7 @@ function buildDiscoveryEnv(stateDir: string): NodeJS.ProcessEnv {
5867return {
5968OPENCLAW_STATE_DIR: stateDir,
6069OPENCLAW_HOME: undefined,
70+OPENCLAW_DISABLE_BUNDLED_PLUGINS: "1",
6171OPENCLAW_BUNDLED_PLUGINS_DIR: "/nonexistent/bundled/plugins",
6272};
6373}
@@ -483,6 +493,7 @@ describe("discoverOpenClawPlugins", () => {
483493const { candidates, diagnostics } = discoverOpenClawPlugins({
484494env: {
485495 ...buildDiscoveryEnv(stateDir),
496+OPENCLAW_DISABLE_BUNDLED_PLUGINS: undefined,
486497OPENCLAW_BUNDLED_PLUGINS_DIR: bundledDir,
487498},
488499});
@@ -504,6 +515,7 @@ describe("discoverOpenClawPlugins", () => {
504515extraPaths: [bundledPluginDir],
505516env: {
506517 ...buildDiscoveryEnv(stateDir),
518+OPENCLAW_DISABLE_BUNDLED_PLUGINS: undefined,
507519OPENCLAW_BUNDLED_PLUGINS_DIR: bundledRoot,
508520},
509521});
@@ -537,6 +549,7 @@ describe("discoverOpenClawPlugins", () => {
537549extraPaths: [legacyPluginDir],
538550env: {
539551 ...buildDiscoveryEnv(stateDir),
552+OPENCLAW_DISABLE_BUNDLED_PLUGINS: undefined,
540553OPENCLAW_BUNDLED_PLUGINS_DIR: bundledRoot,
541554},
542555});
@@ -577,6 +590,7 @@ describe("discoverOpenClawPlugins", () => {
577590const { candidates, diagnostics } = discoverOpenClawPlugins({
578591env: {
579592 ...buildDiscoveryEnv(stateDir),
593+OPENCLAW_DISABLE_BUNDLED_PLUGINS: undefined,
580594OPENCLAW_BUNDLED_PLUGINS_DIR: bundledRoot,
581595},
582596});
@@ -628,6 +642,7 @@ describe("discoverOpenClawPlugins", () => {
628642const { candidates, diagnostics } = discoverOpenClawPlugins({
629643env: {
630644 ...buildDiscoveryEnv(stateDir),
645+OPENCLAW_DISABLE_BUNDLED_PLUGINS: undefined,
631646OPENCLAW_BUNDLED_PLUGINS_DIR: bundledRoot,
632647},
633648});
@@ -1425,6 +1440,7 @@ describe("discoverOpenClawPlugins", () => {
14251440});
1426144114271442const env = buildCachedDiscoveryEnv(stateDir, {
1443+OPENCLAW_DISABLE_BUNDLED_PLUGINS: undefined,
14281444OPENCLAW_BUNDLED_PLUGINS_DIR: bundledDir,
14291445});
14301446const readdirSync = vi.spyOn(fs, "readdirSync");
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。