@@ -211,6 +211,16 @@ function createManifestRegistryFixture(): PluginManifestRegistry {
211211 origin : "global" ,
212212 activation : { onStartup : true } ,
213213 } ,
214+ {
215+ id : "source-external-startup" ,
216+ enabledByDefault : true ,
217+ activation : { onStartup : true } ,
218+ channels : [ "source-external-channel" ] ,
219+ providers : [ "source-external-provider" ] ,
220+ packageManifest : {
221+ build : { bundledDist : false } ,
222+ } ,
223+ } ,
214224 {
215225 id : "demo-config-startup" ,
216226 enabledByDefault : true ,
@@ -314,6 +324,7 @@ function createInstalledPluginRecordFixture(
314324 origin : record . origin ,
315325 enabled : true ,
316326 ...( record . enabledByDefault === true ? { enabledByDefault : true } : { } ) ,
327+ ...( record . packageManifest ?. build ? { packageBuild : record . packageManifest . build } : { } ) ,
317328 startup : {
318329 sidecar : record . activation ?. onStartup === true ,
319330 memory,
@@ -1429,6 +1440,72 @@ describe("resolveGatewayStartupPluginIds", () => {
14291440 } ) ;
14301441 } ) ;
14311442
1443+ it ( "does not ambient-start source-discovered external plugins from onStartup alone" , ( ) => {
1444+ expectStartupPluginIds ( {
1445+ config : createStartupConfig ( {
1446+ noConfiguredChannels : true ,
1447+ memorySlot : "none" ,
1448+ } ) ,
1449+ expected : [ "browser" ] ,
1450+ } ) ;
1451+ } ) ;
1452+
1453+ it . each ( [
1454+ [
1455+ "plugins.entries" ,
1456+ createStartupConfig ( {
1457+ enabledPluginIds : [ "source-external-startup" ] ,
1458+ noConfiguredChannels : true ,
1459+ memorySlot : "none" ,
1460+ } ) ,
1461+ [ "browser" , "source-external-startup" ] ,
1462+ ] ,
1463+ [
1464+ "plugins.allow" ,
1465+ createStartupConfig ( {
1466+ allowPluginIds : [ "source-external-startup" ] ,
1467+ noConfiguredChannels : true ,
1468+ memorySlot : "none" ,
1469+ } ) ,
1470+ [ "source-external-startup" ] ,
1471+ ] ,
1472+ ] ) (
1473+ "starts source-discovered external plugins explicitly selected through %s" ,
1474+ ( _name , config , expected ) => {
1475+ expectStartupPluginIds ( {
1476+ config,
1477+ expected,
1478+ } ) ;
1479+ } ,
1480+ ) ;
1481+
1482+ it . each ( [
1483+ [
1484+ "configured channel" ,
1485+ {
1486+ channels : {
1487+ "source-external-channel" : { enabled : true } ,
1488+ } ,
1489+ plugins : {
1490+ slots : { memory : "none" } ,
1491+ } ,
1492+ } as OpenClawConfig ,
1493+ ] ,
1494+ [
1495+ "selected provider" ,
1496+ createStartupConfig ( {
1497+ modelId : "source-external-provider/demo-model" ,
1498+ noConfiguredChannels : true ,
1499+ memorySlot : "none" ,
1500+ } ) ,
1501+ ] ,
1502+ ] ) ( "preserves %s activation for source-discovered external plugins" , ( _name , config ) => {
1503+ expectStartupPluginIds ( {
1504+ config,
1505+ expected : [ "browser" , "source-external-startup" ] ,
1506+ } ) ;
1507+ } ) ;
1508+
14321509 it ( "loads explicit trusted policy plugins at startup" , ( ) => {
14331510 expectStartupPluginIds ( {
14341511 config : createStartupConfig ( {
0 commit comments