@@ -15,6 +15,7 @@ import {
1515} from "../plugins/installed-plugin-index-records.js" ;
1616import { loadInstalledPluginIndex } from "../plugins/installed-plugin-index.js" ;
1717import { hasRetainedManagedNpmInstallMarker } from "../plugins/managed-npm-retention.js" ;
18+ import { resolveInstalledManifestRegistryIndexFingerprint } from "../plugins/manifest-registry-installed.js" ;
1819import { refreshPluginRegistry } from "../plugins/plugin-registry.js" ;
1920import {
2021 listStaleLocalBundledPluginInstallRecords ,
@@ -47,6 +48,11 @@ type PluginRegistryDoctorRepairParams = Omit<PluginRegistryInstallMigrationParam
4748 prompter : Pick < DoctorPrompter , "shouldRepair" > ;
4849 } ;
4950
51+ type PluginRegistryDoctorRepairResult = {
52+ config : OpenClawConfig ;
53+ pluginInventoryChanged ?: true ;
54+ } ;
55+
5056type StaleManagedNpmBundledPlugin = {
5157 pluginId : string ;
5258 packageName : string ;
@@ -577,7 +583,7 @@ function assertNeverPluginRegistryIssue(issue: never): never {
577583 */
578584export async function maybeRepairPluginRegistryState (
579585 params : PluginRegistryDoctorRepairParams ,
580- ) : Promise < OpenClawConfig > {
586+ ) : Promise < PluginRegistryDoctorRepairResult > {
581587 const preflight = preflightPluginRegistryInstallMigration ( params ) ;
582588
583589 const migrationParams = {
@@ -611,7 +617,7 @@ export async function maybeRepairPluginRegistryState(
611617 "Plugin registry" ,
612618 ) ;
613619 }
614- return params . config ;
620+ return { config : params . config } ;
615621 }
616622
617623 if ( preflight . action === "migrate" ) {
@@ -634,7 +640,10 @@ export async function maybeRepairPluginRegistryState(
634640 "Plugin registry" ,
635641 ) ;
636642 }
637- return params . config ;
643+ return {
644+ config : params . config ,
645+ ...( result . migrated ? { pluginInventoryChanged : true as const } : { } ) ,
646+ } ;
638647 }
639648
640649 if (
@@ -662,7 +671,16 @@ export async function maybeRepairPluginRegistryState(
662671 `Plugin registry refreshed: ${ enabled } /${ total } enabled plugins indexed.` ,
663672 "Plugin registry" ,
664673 ) ;
674+ const indexChanged =
675+ resolveInstalledManifestRegistryIndexFingerprint ( preflight . current ) !==
676+ resolveInstalledManifestRegistryIndexFingerprint ( index ) ;
677+ return {
678+ config : params . config ,
679+ ...( indexChanged || repairedPluginOpenClawHostLinks
680+ ? { pluginInventoryChanged : true as const }
681+ : { } ) ,
682+ } ;
665683 }
666684
667- return params . config ;
685+ return { config : params . config } ;
668686}
0 commit comments