diff --git a/scripts/check-plugin-extension-import-boundary.mjs b/scripts/check-plugin-extension-import-boundary.mjs index bbe9f9702f5..ac9c5e178a4 100644 --- a/scripts/check-plugin-extension-import-boundary.mjs +++ b/scripts/check-plugin-extension-import-boundary.mjs @@ -195,6 +195,7 @@ function scanWebSearchRegistrySmells(sourceFile, filePath) { function shouldSkipFile(filePath) { const relativeFile = normalizePath(filePath); return ( + relativeFile === "src/plugins/bundled-web-search-registry.ts" || relativeFile.startsWith("src/plugins/contracts/") || /^src\/plugins\/runtime\/runtime-[^/]+-contract\.[cm]?[jt]s$/u.test(relativeFile) ); diff --git a/src/wizard/setup.finalize.test.ts b/src/wizard/setup.finalize.test.ts index 7ceeab37c23..a701eec35fb 100644 --- a/src/wizard/setup.finalize.test.ts +++ b/src/wizard/setup.finalize.test.ts @@ -49,6 +49,23 @@ const listConfiguredWebSearchProviders = vi.hoisted(() => vi.fn<(params?: { config?: OpenClawConfig }) => PluginWebSearchProviderEntry[]>(() => []), ); +function createWebSearchProviderEntry( + entry: Omit< + PluginWebSearchProviderEntry, + "pluginId" | "getCredentialValue" | "setCredentialValue" | "createTool" + > & { + pluginId?: string; + }, +): PluginWebSearchProviderEntry { + return { + ...entry, + pluginId: entry.pluginId ?? entry.id, + getCredentialValue: () => undefined, + setCredentialValue: () => {}, + createTool: () => null, + }; +} + vi.mock("../commands/onboard-helpers.js", () => ({ detectBrowserOpenSupport: vi.fn(async () => ({ ok: false })), formatControlUiSshHint: vi.fn(() => "ssh hint"), diff --git a/test/plugin-extension-import-boundary.test.ts b/test/plugin-extension-import-boundary.test.ts index 94fd9ee7f83..bef7bb57838 100644 --- a/test/plugin-extension-import-boundary.test.ts +++ b/test/plugin-extension-import-boundary.test.ts @@ -21,12 +21,15 @@ function readBaseline() { } describe("plugin extension import boundary inventory", () => { - it("keeps web-search-providers out of the remaining inventory", async () => { + it("keeps dedicated web-search registry shims out of the remaining inventory", async () => { const inventory = await collectPluginExtensionImportBoundaryInventory(); expect(inventory.some((entry) => entry.file === "src/plugins/web-search-providers.ts")).toBe( false, ); + expect( + inventory.some((entry) => entry.file === "src/plugins/bundled-web-search-registry.ts"), + ).toBe(false); }); it("ignores boundary shims by scope", async () => {