From ee2220ca08bb292e70e2821fcf8586fddf4f4051 Mon Sep 17 00:00:00 2001 From: Tak Hoffman <781889+Takhoffman@users.noreply.github.com> Date: Fri, 27 Mar 2026 18:53:10 -0500 Subject: [PATCH] fix(regression): align plugin status with runtime compat --- src/plugins/status.test.ts | 25 +++++++++++++++++++++++-- src/plugins/status.ts | 11 +++++++++-- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/src/plugins/status.test.ts b/src/plugins/status.test.ts index 83830e7c6ca..56c9fba63a1 100644 --- a/src/plugins/status.test.ts +++ b/src/plugins/status.test.ts @@ -13,6 +13,7 @@ const loadConfigMock = vi.fn(); const loadOpenClawPluginsMock = vi.fn(); const resolveBundledProviderCompatPluginIdsMock = vi.fn(); const withBundledPluginAllowlistCompatMock = vi.fn(); +const withBundledPluginEnablementCompatMock = vi.fn(); let buildPluginStatusReport: typeof import("./status.js").buildPluginStatusReport; let buildPluginInspectReport: typeof import("./status.js").buildPluginInspectReport; let buildAllPluginInspectReports: typeof import("./status.js").buildAllPluginInspectReports; @@ -37,6 +38,8 @@ vi.mock("./providers.js", () => ({ vi.mock("./bundled-compat.js", () => ({ withBundledPluginAllowlistCompat: (...args: unknown[]) => withBundledPluginAllowlistCompatMock(...args), + withBundledPluginEnablementCompat: (...args: unknown[]) => + withBundledPluginEnablementCompatMock(...args), })); vi.mock("../agents/agent-scope.js", () => ({ @@ -64,11 +67,15 @@ describe("buildPluginStatusReport", () => { loadOpenClawPluginsMock.mockReset(); resolveBundledProviderCompatPluginIdsMock.mockReset(); withBundledPluginAllowlistCompatMock.mockReset(); + withBundledPluginEnablementCompatMock.mockReset(); loadConfigMock.mockReturnValue({}); resolveBundledProviderCompatPluginIdsMock.mockReturnValue([]); withBundledPluginAllowlistCompatMock.mockImplementation( (params: { config: unknown }) => params.config, ); + withBundledPluginEnablementCompatMock.mockImplementation( + (params: { config: unknown }) => params.config, + ); setPluginLoadResult({ plugins: [] }); ({ buildAllPluginInspectReports, @@ -99,12 +106,22 @@ describe("buildPluginStatusReport", () => { ); }); - it("applies bundled provider allowlist compat before loading plugins", () => { + it("applies the full bundled provider compat chain before loading plugins", () => { const config = { plugins: { allow: ["telegram"] } }; loadConfigMock.mockReturnValue(config); resolveBundledProviderCompatPluginIdsMock.mockReturnValue(["anthropic", "openai"]); const compatConfig = { plugins: { allow: ["telegram", "anthropic", "openai"] } }; + const enabledConfig = { + plugins: { + allow: ["telegram", "anthropic", "openai"], + entries: { + anthropic: { enabled: true }, + openai: { enabled: true }, + }, + }, + }; withBundledPluginAllowlistCompatMock.mockReturnValue(compatConfig); + withBundledPluginEnablementCompatMock.mockReturnValue(enabledConfig); buildPluginStatusReport({ config }); @@ -112,8 +129,12 @@ describe("buildPluginStatusReport", () => { config, pluginIds: ["anthropic", "openai"], }); + expect(withBundledPluginEnablementCompatMock).toHaveBeenCalledWith({ + config: compatConfig, + pluginIds: ["anthropic", "openai"], + }); expect(loadOpenClawPluginsMock).toHaveBeenCalledWith( - expect.objectContaining({ config: compatConfig }), + expect.objectContaining({ config: enabledConfig }), ); }); diff --git a/src/plugins/status.ts b/src/plugins/status.ts index 826fcce0ae4..c88967f2d74 100644 --- a/src/plugins/status.ts +++ b/src/plugins/status.ts @@ -6,7 +6,10 @@ import { createSubsystemLogger } from "../logging/subsystem.js"; import { resolveCompatibilityHostVersion } from "../version.js"; import { inspectBundleLspRuntimeSupport } from "./bundle-lsp.js"; import { inspectBundleMcpRuntimeSupport } from "./bundle-mcp.js"; -import { withBundledPluginAllowlistCompat } from "./bundled-compat.js"; +import { + withBundledPluginAllowlistCompat, + withBundledPluginEnablementCompat, +} from "./bundled-compat.js"; import { normalizePluginsConfig } from "./config-state.js"; import { loadOpenClawPlugins } from "./loader.js"; import { createPluginLoaderLogger } from "./logger.js"; @@ -160,9 +163,13 @@ export function buildPluginStatusReport(params?: { config, pluginIds: bundledProviderIds, }); + const runtimeCompatConfig = withBundledPluginEnablementCompat({ + config: effectiveConfig, + pluginIds: bundledProviderIds, + }); const registry = loadOpenClawPlugins({ - config: effectiveConfig, + config: runtimeCompatConfig, workspaceDir, env: params?.env, logger: createPluginLoaderLogger(log),