From 7cefdd956a9bc6fb2ead81ec53c0b8871f9e43d7 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 28 Apr 2026 20:58:42 +0100 Subject: [PATCH] fix: unblock landing checks (#73235) (thanks @zqchris) --- src/auto-reply/reply/session-reset-prompt.ts | 18 ++++--- src/plugins/loader.test.ts | 52 ++++++++++++-------- 2 files changed, 42 insertions(+), 28 deletions(-) diff --git a/src/auto-reply/reply/session-reset-prompt.ts b/src/auto-reply/reply/session-reset-prompt.ts index c232d59d21e..1ab84f25f6e 100644 --- a/src/auto-reply/reply/session-reset-prompt.ts +++ b/src/auto-reply/reply/session-reset-prompt.ts @@ -77,14 +77,16 @@ export async function resolveBareSessionResetPromptState(params: { ? params.hasBootstrapFileAccess() : (params.hasBootstrapFileAccess ?? true) : true; - const bootstrapMode = resolveBootstrapMode({ - bootstrapPending, - runKind: "default", - isInteractiveUserFacing: true, - isPrimaryRun: params.isPrimaryRun ?? true, - isCanonicalWorkspace: params.isCanonicalWorkspace ?? true, - hasBootstrapFileAccess, - }); + const bootstrapMode = !hasBootstrapFileAccess + ? "none" + : resolveBootstrapMode({ + bootstrapPending, + runKind: "default", + isInteractiveUserFacing: true, + isPrimaryRun: params.isPrimaryRun ?? true, + isCanonicalWorkspace: params.isCanonicalWorkspace ?? true, + hasBootstrapFileAccess, + }); return { bootstrapMode, prompt: buildBareSessionResetPrompt(params.cfg, params.nowMs, bootstrapMode), diff --git a/src/plugins/loader.test.ts b/src/plugins/loader.test.ts index d2ac0a05c09..6d71de6ba72 100644 --- a/src/plugins/loader.test.ts +++ b/src/plugins/loader.test.ts @@ -2785,7 +2785,7 @@ module.exports = { { label: "loads plugins from config paths", run: () => { - process.env.OPENCLAW_BUNDLED_PLUGINS_DIR = "/nonexistent/bundled/plugins"; + useNoBundledPlugins(); const plugin = writePlugin({ id: "allowed-config-path", filename: "allowed-config-path.cjs", @@ -4373,7 +4373,7 @@ module.exports = { id: "throws-after-import", register() {} };`, }); it("re-initializes global hook runner when serving registry from cache", () => { - process.env.OPENCLAW_BUNDLED_PLUGINS_DIR = "/nonexistent/bundled/plugins"; + useNoBundledPlugins(); const plugin = writePlugin({ id: "cache-hook-runner", filename: "cache-hook-runner.cjs", @@ -6604,7 +6604,6 @@ module.exports = { { label: "enforces memory slot selection", loadRegistry: () => { - process.env.OPENCLAW_BUNDLED_PLUGINS_DIR = "/nonexistent/bundled/plugins"; const memoryA = writePlugin({ id: "memory-a", body: memoryPluginBody("memory-a"), @@ -6614,15 +6613,22 @@ module.exports = { body: memoryPluginBody("memory-b"), }); - return loadOpenClawPlugins({ - cache: false, - config: { - plugins: { - load: { paths: [memoryA.file, memoryB.file] }, - slots: { memory: "memory-b" }, - }, + return withEnv( + { + OPENCLAW_DISABLE_BUNDLED_PLUGINS: "1", + OPENCLAW_BUNDLED_PLUGINS_DIR: undefined, }, - }); + () => + loadOpenClawPlugins({ + cache: false, + config: { + plugins: { + load: { paths: [memoryA.file, memoryB.file] }, + slots: { memory: "memory-b" }, + }, + }, + }), + ); }, assert: (registry: ReturnType) => { const a = registry.plugins.find((entry) => entry.id === "memory-a"); @@ -6871,21 +6877,27 @@ module.exports = { { label: "disables memory plugins when slot is none", loadRegistry: () => { - process.env.OPENCLAW_BUNDLED_PLUGINS_DIR = "/nonexistent/bundled/plugins"; const memory = writePlugin({ id: "memory-off", body: memoryPluginBody("memory-off"), }); - return loadOpenClawPlugins({ - cache: false, - config: { - plugins: { - load: { paths: [memory.file] }, - slots: { memory: "none" }, - }, + return withEnv( + { + OPENCLAW_DISABLE_BUNDLED_PLUGINS: "1", + OPENCLAW_BUNDLED_PLUGINS_DIR: undefined, }, - }); + () => + loadOpenClawPlugins({ + cache: false, + config: { + plugins: { + load: { paths: [memory.file] }, + slots: { memory: "none" }, + }, + }, + }), + ); }, assert: (registry: ReturnType) => { const entry = registry.plugins.find((item) => item.id === "memory-off");