From 06219e46f1ee79c97ff07326035f98486d9f15fc Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Sun, 12 Jul 2026 18:47:00 +0200 Subject: [PATCH] refactor(channels): remove unused bootstrap list (#105531) --- src/channels/plugins/bootstrap-registry.ts | 10 ------ .../plugins/bundled-root-caches.test.ts | 32 ------------------- 2 files changed, 42 deletions(-) diff --git a/src/channels/plugins/bootstrap-registry.ts b/src/channels/plugins/bootstrap-registry.ts index 0eb43b21e552..76008c47cd5b 100644 --- a/src/channels/plugins/bootstrap-registry.ts +++ b/src/channels/plugins/bootstrap-registry.ts @@ -4,8 +4,6 @@ * Provides channel plugin metadata before the full runtime registry is installed. */ import { normalizeOptionalString } from "@openclaw/normalization-core/string-coerce"; -import { listBundledChannelPluginIdsForRoot } from "./bundled-ids.js"; -import { resolveBundledChannelRootScope } from "./bundled-root.js"; import { getBundledChannelPlugin, getBundledChannelSecrets, @@ -66,14 +64,6 @@ function mergeBootstrapPlugin( } as ChannelPlugin; } -/** - * Lists bundled channel ids visible to bootstrap for the current root scope. - */ -export function listBootstrapChannelPluginIds(): readonly string[] { - const rootScope = resolveBundledChannelRootScope(); - return listBundledChannelPluginIdsForRoot(rootScope.cacheKey); -} - /** * Loads a bundled channel plugin for bootstrap, merging runtime and setup artifacts. */ diff --git a/src/channels/plugins/bundled-root-caches.test.ts b/src/channels/plugins/bundled-root-caches.test.ts index de2ea3cd00b3..b5402c45ec4f 100644 --- a/src/channels/plugins/bundled-root-caches.test.ts +++ b/src/channels/plugins/bundled-root-caches.test.ts @@ -51,7 +51,6 @@ afterEach(() => { vi.resetModules(); vi.doUnmock("../../plugins/channel-catalog-registry.js"); vi.doUnmock("./bundled.js"); - vi.doUnmock("./bundled-ids.js"); }); describe("bundled root-aware plugin lookups", () => { @@ -90,18 +89,6 @@ describe("bundled root-aware plugin lookups", () => { const rootA = makeBundledRoot("openclaw-bootstrap-a-"); const rootB = makeBundledRoot("openclaw-bootstrap-b-"); - vi.doMock("./bundled-ids.js", () => ({ - listBundledChannelPluginIdsForRoot: () => { - if (process.env.OPENCLAW_BUNDLED_PLUGINS_DIR === rootA.pluginsDir) { - return ["alpha"]; - } - if (process.env.OPENCLAW_BUNDLED_PLUGINS_DIR === rootB.pluginsDir) { - return ["beta"]; - } - return []; - }, - })); - vi.doMock("./bundled.js", () => ({ getBundledChannelPlugin: (id: string) => ({ id, @@ -143,14 +130,12 @@ describe("bundled root-aware plugin lookups", () => { ); process.env.OPENCLAW_BUNDLED_PLUGINS_DIR = rootA.pluginsDir; - expect(bootstrapRegistry.listBootstrapChannelPluginIds()).toEqual(["alpha"]); expect(bootstrapRegistry.getBootstrapChannelPlugin("alpha")?.meta.label).toBe("setup-A"); expect( bootstrapRegistry.getBootstrapChannelSecrets("alpha")?.secretTargetRegistryEntries?.[0]?.id, ).toBe("setup-alpha-A"); process.env.OPENCLAW_BUNDLED_PLUGINS_DIR = rootB.pluginsDir; - expect(bootstrapRegistry.listBootstrapChannelPluginIds()).toEqual(["beta"]); expect(bootstrapRegistry.getBootstrapChannelPlugin("beta")?.meta.label).toBe("setup-B"); expect( bootstrapRegistry.getBootstrapChannelSecrets("beta")?.secretTargetRegistryEntries?.[0]?.id, @@ -158,13 +143,6 @@ describe("bundled root-aware plugin lookups", () => { }); it("retries bootstrap plugin loading after an error", async () => { - const root = makeBundledRoot("openclaw-bootstrap-plugin-throw-"); - - vi.doMock("./bundled-ids.js", () => ({ - listBundledChannelPluginIdsForRoot: () => - process.env.OPENCLAW_BUNDLED_PLUGINS_DIR === root.pluginsDir ? ["alpha"] : [], - })); - const getBundledChannelPluginMock = vi.fn(() => { throw new Error("Cannot find module 'nostr-tools'"); }); @@ -184,8 +162,6 @@ describe("bundled root-aware plugin lookups", () => { "./bootstrap-registry.js?scope=bootstrap-plugin-load-guard", ); - process.env.OPENCLAW_BUNDLED_PLUGINS_DIR = root.pluginsDir; - expect(bootstrapRegistry.listBootstrapChannelPluginIds()).toEqual(["alpha"]); expect(bootstrapRegistry.getBootstrapChannelPlugin("alpha")).toBeUndefined(); expect(bootstrapRegistry.getBootstrapChannelPlugin("alpha")).toBeUndefined(); expect(bootstrapRegistry.getBootstrapChannelSecrets("alpha")).toBeUndefined(); @@ -194,13 +170,6 @@ describe("bundled root-aware plugin lookups", () => { }); it("keeps plugin loading independent from bootstrap secrets loading errors", async () => { - const root = makeBundledRoot("openclaw-bootstrap-secrets-throw-"); - - vi.doMock("./bundled-ids.js", () => ({ - listBundledChannelPluginIdsForRoot: () => - process.env.OPENCLAW_BUNDLED_PLUGINS_DIR === root.pluginsDir ? ["alpha"] : [], - })); - const getBundledChannelSecretsMock = vi.fn(() => { throw new Error("Cannot find module '@larksuiteoapi/node-sdk'"); }); @@ -223,7 +192,6 @@ describe("bundled root-aware plugin lookups", () => { "./bootstrap-registry.js?scope=bootstrap-secrets-load-guard", ); - process.env.OPENCLAW_BUNDLED_PLUGINS_DIR = root.pluginsDir; expect(bootstrapRegistry.getBootstrapChannelSecrets("alpha")).toBeUndefined(); expect(bootstrapRegistry.getBootstrapChannelSecrets("alpha")).toBeUndefined(); expect(bootstrapRegistry.getBootstrapChannelPlugin("alpha")).toEqual({