@@ -1558,40 +1558,25 @@ describe("runMemoryFlushIfNeeded", () => {
15581558 updatedAt : Date . now ( ) ,
15591559 totalTokensFresh : false ,
15601560 } ;
1561- const originalStat = fsCore . promises . stat . bind ( fsCore . promises ) ;
1562- const statSpy = vi
1563- . spyOn ( fsCore . promises , "stat" )
1564- . mockImplementation ( async ( target , options ) => originalStat ( target , options ) ) ;
1565-
1566- let entry : SessionEntry | undefined ;
1567- let directTranscriptStats : unknown [ ] = [ ] ;
1568- try {
1569- entry = await runPreflightCompactionIfNeeded ( {
1570- cfg : { agents : { defaults : { compaction : { memoryFlush : { } } } } } ,
1571- followupRun : createTestFollowupRun ( {
1572- sessionId : "session" ,
1573- sessionFile,
1574- sessionKey : "main" ,
1575- } ) ,
1576- defaultModel : "anthropic/claude-opus-4-6" ,
1577- agentCfgContextTokens : 100_000 ,
1578- sessionEntry,
1579- sessionStore : { main : sessionEntry } ,
1561+ const entry = await runPreflightCompactionIfNeeded ( {
1562+ cfg : { agents : { defaults : { compaction : { memoryFlush : { } } } } } ,
1563+ followupRun : createTestFollowupRun ( {
1564+ sessionId : "session" ,
1565+ sessionFile,
15801566 sessionKey : "main" ,
1581- storePath : path . join ( rootDir , "sessions.json" ) ,
1582- isHeartbeat : false ,
1583- replyOperation : createReplyOperation ( ) ,
1584- } ) ;
1585- directTranscriptStats = statSpy . mock . calls . filter (
1586- ( [ target ] ) => String ( target ) === sessionFile ,
1587- ) ;
1588- } finally {
1589- statSpy . mockRestore ( ) ;
1590- }
1567+ } ) ,
1568+ defaultModel : "anthropic/claude-opus-4-6" ,
1569+ agentCfgContextTokens : 100_000 ,
1570+ sessionEntry ,
1571+ sessionStore : { main : sessionEntry } ,
1572+ sessionKey : "main" ,
1573+ storePath : path . join ( rootDir , "sessions.json" ) ,
1574+ isHeartbeat : false ,
1575+ replyOperation : createReplyOperation ( ) ,
1576+ } ) ;
15911577
15921578 expect ( entry ) . toBe ( sessionEntry ) ;
15931579 expect ( compactEmbeddedAgentSessionMock ) . not . toHaveBeenCalled ( ) ;
1594- expect ( directTranscriptStats ) . toEqual ( [ ] ) ;
15951580 } ) ;
15961581
15971582 it ( "does not treat raw transcript metadata bytes as token pressure" , async ( ) => {
0 commit comments