@@ -1637,6 +1637,62 @@ describe("updateNpmInstalledPlugins", () => {
16371637 ] ) ;
16381638 } ) ;
16391639
1640+ it . each ( [
1641+ {
1642+ caseName : "independently versioned official catalog plugins" ,
1643+ pluginId : "openclaw-plugin-yuanbao" ,
1644+ packageName : "openclaw-plugin-yuanbao" ,
1645+ version : "2.15.0" ,
1646+ coreVersion : "2026.7.1-beta.5" ,
1647+ } ,
1648+ {
1649+ caseName : "newer lockstep exact pins" ,
1650+ pluginId : "codex" ,
1651+ packageName : "@openclaw/codex" ,
1652+ version : "2026.8.1" ,
1653+ coreVersion : "2026.7.1-beta.5" ,
1654+ } ,
1655+ ] ) ( "keeps the normal up-to-date message for $caseName" , async ( fixture ) => {
1656+ const installPath = createInstalledPackageDir ( {
1657+ name : fixture . packageName ,
1658+ version : fixture . version ,
1659+ } ) ;
1660+ fs . mkdirSync ( path . join ( installPath , "node_modules" , "openclaw" ) , { recursive : true } ) ;
1661+ mockNpmViewMetadata ( {
1662+ name : fixture . packageName ,
1663+ version : fixture . version ,
1664+ integrity : "sha512-same" ,
1665+ shasum : "same" ,
1666+ } ) ;
1667+ installPluginFromNpmSpecMock . mockRejectedValue ( new Error ( "installer should not run" ) ) ;
1668+
1669+ const result = await updateNpmInstalledPlugins ( {
1670+ config : createNpmInstallConfig ( {
1671+ pluginId : fixture . pluginId ,
1672+ spec : `${ fixture . packageName } @${ fixture . version } ` ,
1673+ installPath,
1674+ resolvedName : fixture . packageName ,
1675+ resolvedVersion : fixture . version ,
1676+ resolvedSpec : `${ fixture . packageName } @${ fixture . version } ` ,
1677+ integrity : "sha512-same" ,
1678+ shasum : "same" ,
1679+ } ) ,
1680+ pluginIds : [ fixture . pluginId ] ,
1681+ coreVersion : fixture . coreVersion ,
1682+ } ) ;
1683+
1684+ expect ( installPluginFromNpmSpecMock ) . not . toHaveBeenCalled ( ) ;
1685+ expect ( result . outcomes ) . toEqual ( [
1686+ {
1687+ pluginId : fixture . pluginId ,
1688+ status : "unchanged" ,
1689+ currentVersion : fixture . version ,
1690+ nextVersion : fixture . version ,
1691+ message : `${ fixture . pluginId } is up to date (${ fixture . version } ).` ,
1692+ } ,
1693+ ] ) ;
1694+ } ) ;
1695+
16401696 it ( "repairs openclaw peer links after batch npm updates prune earlier plugin links" , async ( ) => {
16411697 const plugins = [
16421698 { pluginId : "brave" , packageName : "@openclaw/brave-plugin" } ,
@@ -2393,6 +2449,63 @@ describe("updateNpmInstalledPlugins", () => {
23932449 } ) ;
23942450 } ) ;
23952451
2452+ it . each ( [
2453+ {
2454+ caseName : "independently versioned official catalog plugins" ,
2455+ pluginId : "openclaw-plugin-yuanbao" ,
2456+ packageName : "openclaw-plugin-yuanbao" ,
2457+ version : "2.15.0" ,
2458+ coreVersion : "2026.7.1-beta.5" ,
2459+ } ,
2460+ {
2461+ caseName : "newer lockstep exact pins" ,
2462+ pluginId : "codex" ,
2463+ packageName : "@openclaw/codex" ,
2464+ version : "2026.8.1" ,
2465+ coreVersion : "2026.7.1-beta.5" ,
2466+ } ,
2467+ ] ) ( "keeps the dry-run up-to-date message for $caseName" , async ( fixture ) => {
2468+ const installPath = createInstalledPackageDir ( {
2469+ name : fixture . packageName ,
2470+ version : fixture . version ,
2471+ } ) ;
2472+ installPluginFromNpmSpecMock . mockResolvedValue (
2473+ createSuccessfulNpmUpdateResult ( {
2474+ pluginId : fixture . pluginId ,
2475+ targetDir : installPath ,
2476+ version : fixture . version ,
2477+ npmResolution : {
2478+ name : fixture . packageName ,
2479+ version : fixture . version ,
2480+ resolvedSpec : `${ fixture . packageName } @${ fixture . version } ` ,
2481+ } ,
2482+ } ) ,
2483+ ) ;
2484+
2485+ const result = await updateNpmInstalledPlugins ( {
2486+ config : createNpmInstallConfig ( {
2487+ pluginId : fixture . pluginId ,
2488+ spec : `${ fixture . packageName } @${ fixture . version } ` ,
2489+ installPath,
2490+ resolvedName : fixture . packageName ,
2491+ resolvedSpec : `${ fixture . packageName } @${ fixture . version } ` ,
2492+ resolvedVersion : fixture . version ,
2493+ } ) ,
2494+ pluginIds : [ fixture . pluginId ] ,
2495+ dryRun : true ,
2496+ coreVersion : fixture . coreVersion ,
2497+ } ) ;
2498+
2499+ expect ( runCommandWithTimeoutMock ) . toHaveBeenCalledTimes ( 1 ) ;
2500+ expectRecordFields ( result . outcomes [ 0 ] , {
2501+ pluginId : fixture . pluginId ,
2502+ status : "unchanged" ,
2503+ currentVersion : fixture . version ,
2504+ nextVersion : fixture . version ,
2505+ message : `${ fixture . pluginId } is up to date (${ fixture . version } ).` ,
2506+ } ) ;
2507+ } ) ;
2508+
23962509 it ( "reinstalls missing exact official npm pins without official install sync" , async ( ) => {
23972510 const extensionsDir = fs . mkdtempSync ( path . join ( os . tmpdir ( ) , "openclaw-missing-plugin-" ) ) ;
23982511 tempDirs . push ( extensionsDir ) ;
0 commit comments