@@ -639,6 +639,7 @@ describe("runDoctorConfigPreflight state migration", () => {
639639 expect ( runPostCorePluginConvergence ) . toHaveBeenCalledWith ( {
640640 cfg : { gateway : { mode : "local" , port : 19091 } } ,
641641 env : process . env ,
642+ compatibilityHostVersion : expect . any ( String ) ,
642643 baselineInstallRecords : { } ,
643644 } ) ;
644645 expect ( recordSuccessfulStartupMigrations ) . toHaveBeenCalledWith ( {
@@ -649,6 +650,33 @@ describe("runDoctorConfigPreflight state migration", () => {
649650 expect ( startupMigrationLeaseRelease ) . toHaveBeenCalledOnce ( ) ;
650651 } ) ;
651652
653+ it ( "pins startup plugin convergence to the explicit compatibility host version" , async ( ) => {
654+ needsStartupMigrationCheckpoint . mockReturnValue ( true ) ;
655+ const previousHostVersion = process . env . OPENCLAW_COMPATIBILITY_HOST_VERSION ;
656+ process . env . OPENCLAW_COMPATIBILITY_HOST_VERSION = "2026.7.2-beta.7" ;
657+
658+ try {
659+ await runDoctorConfigPreflight ( {
660+ migrateLegacyConfig : false ,
661+ invalidConfigNote : false ,
662+ requireStartupMigrationCheckpoint : true ,
663+ } ) ;
664+ } finally {
665+ if ( previousHostVersion === undefined ) {
666+ delete process . env . OPENCLAW_COMPATIBILITY_HOST_VERSION ;
667+ } else {
668+ process . env . OPENCLAW_COMPATIBILITY_HOST_VERSION = previousHostVersion ;
669+ }
670+ }
671+
672+ expect ( runPostCorePluginConvergence ) . toHaveBeenCalledWith ( {
673+ cfg : { gateway : { mode : "local" , port : 19091 } } ,
674+ env : expect . any ( Object ) ,
675+ compatibilityHostVersion : "2026.7.2-beta.7" ,
676+ baselineInstallRecords : { } ,
677+ } ) ;
678+ } ) ;
679+
652680 it ( "refuses startup when plugin migration inputs change during convergence" , async ( ) => {
653681 needsStartupMigrationCheckpoint . mockReturnValue ( true ) ;
654682 pluginMigrationFingerprint
0 commit comments