@@ -996,12 +996,12 @@ describe("runCronIsolatedAgentTurn message tool policy", () => {
996996 expect ( getAgentRunContext ( "test-session-id" ) ) . toBeUndefined ( ) ;
997997 } ) ;
998998
999- it ( "keeps shared cron run context references active after completion" , async ( ) => {
999+ it ( "releases preexisting run context after detached current-session completion" , async ( ) => {
10001000 const cronSession = makeCronSession ( {
10011001 store : { "agent:default:cron:message-tool-policy" : { retained : true } } ,
10021002 } ) ;
10031003 resolveCronSessionMock . mockReturnValue ( cronSession ) ;
1004- const { clearAgentRunContext , getAgentRunContext, registerAgentRunContext } =
1004+ const { getAgentRunContext, registerAgentRunContext } =
10051005 await import ( "../../infra/agent-events.js" ) ;
10061006 registerAgentRunContext ( "test-session-id" , {
10071007 sessionKey : "agent:default:cron:message-tool-policy" ,
@@ -1015,11 +1015,8 @@ describe("runCronIsolatedAgentTurn message tool policy", () => {
10151015 job : currentSessionJob as never ,
10161016 } ) ;
10171017
1018- expect ( getAgentRunContext ( "test-session-id" ) ) . toMatchObject ( {
1019- sessionKey : "agent:default:cron:message-tool-policy" ,
1020- } ) ;
1018+ expect ( getAgentRunContext ( "test-session-id" ) ) . toBeUndefined ( ) ;
10211019 expect ( cronSession . store ) . toBeUndefined ( ) ;
1022- clearAgentRunContext ( "test-session-id" ) ;
10231020 } ) ;
10241021
10251022 it ( "releases a shared cron run context created by this invocation" , async ( ) => {
0 commit comments