@@ -63,7 +63,11 @@ import {
6363 registerMemoryPromptSupplement ,
6464 resolveMemoryFlushPlan ,
6565} from "./memory-state.test-fixtures.js" ;
66- import { isPluginRegistryRetired } from "./registry-lifecycle.js" ;
66+ import {
67+ activatePluginRecordLifecycleEpoch ,
68+ isPluginRecordLifecycleEpochActive ,
69+ isPluginRegistryRetired ,
70+ } from "./registry-lifecycle.js" ;
6771import { createEmptyPluginRegistry } from "./registry.js" ;
6872import {
6973 getActivePluginRegistry ,
@@ -393,6 +397,10 @@ describe("loadOpenClawPlugins", () => {
393397 const priorKey = getActivePluginRegistryKey ( ) ;
394398 const priorMode = getActivePluginRuntimeSubagentMode ( ) ;
395399 const priorWorkspaceDir = getActivePluginRegistryWorkspaceDir ( ) ;
400+ const priorRecord = priorRegistry . plugins . find ( ( entry ) => entry . id === "activation-prior" ) ;
401+ expect ( priorRecord ) . toBeDefined ( ) ;
402+ const priorEpoch = activatePluginRecordLifecycleEpoch ( priorRegistry , priorRecord ! ) ;
403+ expect ( priorEpoch ) . toBeDefined ( ) ;
396404
397405 const replacement = writePlugin ( {
398406 id : "activation-replacement" ,
@@ -437,10 +445,14 @@ describe("loadOpenClawPlugins", () => {
437445 expect ( getActivePluginRuntimeSubagentMode ( ) ) . toBe ( priorMode ) ;
438446 expect ( getActivePluginRegistryWorkspaceDir ( ) ) . toBe ( priorWorkspaceDir ) ;
439447 expect ( getPluginCommandSpecs ( ) . map ( ( command ) => command . name ) ) . toEqual ( [ "prior" ] ) ;
448+ expect ( isPluginRecordLifecycleEpochActive ( priorRegistry , priorRecord ! , priorEpoch ! ) ) . toBe ( true ) ;
440449
441450 const activated = loadOpenClawPlugins ( replacementOptions ) ;
442451 expect ( activated . commands . map ( ( entry ) => entry . command . name ) ) . toEqual ( [ "replacement" ] ) ;
443452 expect ( getPluginCommandSpecs ( ) . map ( ( command ) => command . name ) ) . toEqual ( [ "replacement" ] ) ;
453+ expect ( isPluginRecordLifecycleEpochActive ( priorRegistry , priorRecord ! , priorEpoch ! ) ) . toBe (
454+ false ,
455+ ) ;
444456 } ) ;
445457
446458 it ( "fails plugin registration when a hook is missing its required name" , ( ) => {
0 commit comments