@@ -657,18 +657,19 @@ describe("resolvePluginCapabilityProviders", () => {
657657 } ) ;
658658 } ) ;
659659
660- 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" , ( ) => {
661661 const 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 ) ;
672673
673674 expectNoResolvedCapabilityProviders (
674675 resolvePluginCapabilityProviders ( {
@@ -677,12 +678,11 @@ describe("resolvePluginCapabilityProviders", () => {
677678 } ) ,
678679 ) ;
679680
680- 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 } ) ;
687687
688688 it . each ( [
@@ -845,27 +845,19 @@ describe("resolvePluginCapabilityProviders", () => {
845845 } ) ;
846846 } ) ;
847847
848- 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" , ( ) => {
849849 const 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 ) ;
869861
870862 const provider = resolvePluginCapabilityProvider ( {
871863 key : "memoryEmbeddingProviders" ,
@@ -874,11 +866,10 @@ describe("resolvePluginCapabilityProviders", () => {
874866 } ) ;
875867
876868 expect ( 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} ) ;
0 commit comments