





















@@ -657,18 +657,19 @@ describe("resolvePluginCapabilityProviders", () => {
657657});
658658});
659659660-it("keeps bundled runtime dependency repair disabled when plugins are globally disabled", () => {
660+it("does not load bundled capability providers when plugins are globally disabled", () => {
661661const cfg = { plugins: { enabled: false, allow: ["custom-plugin"] } } as OpenClawConfig;
662-const enablementCompat = {
663-plugins: {
664-enabled: true,
665-allow: ["custom-plugin", "openai"],
666-entries: { openai: { enabled: true } },
662+const loaded = createEmptyPluginRegistry();
663+loaded.mediaUnderstandingProviders.push({
664+pluginId: "openai",
665+pluginName: "openai",
666+source: "test",
667+provider: {
668+id: "openai",
669+capabilities: ["image"],
667670},
668-};
669-setBundledCapabilityFixture("mediaUnderstandingProviders");
670-mocks.withBundledPluginEnablementCompat.mockReturnValue(enablementCompat);
671-mocks.withBundledPluginVitestCompat.mockReturnValue(enablementCompat);
671+} as never);
672+mocks.resolveRuntimePluginRegistry.mockReturnValue(loaded);
672673673674expectNoResolvedCapabilityProviders(
674675resolvePluginCapabilityProviders({
@@ -677,12 +678,11 @@ describe("resolvePluginCapabilityProviders", () => {
677678}),
678679);
679680680-expect(mocks.resolveRuntimePluginRegistry).toHaveBeenCalledWith({
681-config: enablementCompat,
682-onlyPluginIds: ["openai"],
683-activate: false,
684-installBundledRuntimeDeps: false,
685-});
681+expect(mocks.loadPluginManifestRegistry).not.toHaveBeenCalled();
682+expect(mocks.withBundledPluginAllowlistCompat).not.toHaveBeenCalled();
683+expect(mocks.withBundledPluginEnablementCompat).not.toHaveBeenCalled();
684+expect(mocks.withBundledPluginVitestCompat).not.toHaveBeenCalled();
685+expect(mocks.resolveRuntimePluginRegistry).not.toHaveBeenCalled();
686686});
687687688688it.each([
@@ -845,27 +845,19 @@ describe("resolvePluginCapabilityProviders", () => {
845845});
846846});
847847848-it("keeps targeted provider fallback dependency repair disabled when plugins are globally disabled", () => {
848+it("does not load targeted bundled capability providers when plugins are globally disabled", () => {
849849const cfg = { plugins: { enabled: false, allow: ["custom-plugin"] } } as OpenClawConfig;
850-const enablementCompat = {
851-plugins: {
852-enabled: true,
853-allow: ["custom-plugin", "google"],
854-entries: { google: { enabled: true } },
850+const loaded = createEmptyPluginRegistry();
851+loaded.memoryEmbeddingProviders.push({
852+pluginId: "google",
853+pluginName: "google",
854+source: "test",
855+provider: {
856+id: "gemini",
857+create: async () => ({ provider: null }),
855858},
856-};
857-mocks.loadPluginManifestRegistry.mockReturnValue({
858-plugins: [
859-{
860-id: "google",
861-origin: "bundled",
862-contracts: { memoryEmbeddingProviders: ["gemini"] },
863-},
864-] as never,
865-diagnostics: [],
866-});
867-mocks.withBundledPluginEnablementCompat.mockReturnValue(enablementCompat);
868-mocks.withBundledPluginVitestCompat.mockReturnValue(enablementCompat);
859+} as never);
860+mocks.resolveRuntimePluginRegistry.mockReturnValue(loaded);
869861870862const provider = resolvePluginCapabilityProvider({
871863key: "memoryEmbeddingProviders",
@@ -874,11 +866,10 @@ describe("resolvePluginCapabilityProviders", () => {
874866});
875867876868expect(provider).toBeUndefined();
877-expect(mocks.resolveRuntimePluginRegistry).toHaveBeenCalledWith({
878-config: enablementCompat,
879-onlyPluginIds: ["google"],
880-activate: false,
881-installBundledRuntimeDeps: false,
882-});
869+expect(mocks.loadPluginManifestRegistry).not.toHaveBeenCalled();
870+expect(mocks.withBundledPluginAllowlistCompat).not.toHaveBeenCalled();
871+expect(mocks.withBundledPluginEnablementCompat).not.toHaveBeenCalled();
872+expect(mocks.withBundledPluginVitestCompat).not.toHaveBeenCalled();
873+expect(mocks.resolveRuntimePluginRegistry).not.toHaveBeenCalled();
883874});
884875});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。