@@ -23,7 +23,6 @@ import {
2323 markSessionAbortTarget ,
2424 patchSessionEntry ,
2525 persistSessionResetLifecycle ,
26- persistSessionRolloverLifecycle ,
2726 persistSessionTranscriptTurn ,
2827 purgeDeletedAgentSessionEntries ,
2928 publishTranscriptUpdate ,
@@ -1790,63 +1789,6 @@ describe("session accessor file-backed seam", () => {
17901789 expect ( fs . readFileSync ( nextTranscript , "utf-8" ) ) . toContain ( '"content":"hello"' ) ;
17911790 } ) ;
17921791
1793- it ( "persists rollover entries and returns archived previous transcript info" , async ( ) => {
1794- const now = Date . now ( ) ;
1795- const sessionKey = "agent:main:telegram:dm:user" ;
1796- const retiredKey = "agent:main:main" ;
1797- const previousTranscript = path . join ( tempDir , "previous-rollover.jsonl" ) ;
1798- const previousEntry : SessionEntry = {
1799- sessionFile : previousTranscript ,
1800- sessionId : "previous-rollover" ,
1801- updatedAt : now ,
1802- } ;
1803- const nextEntry : SessionEntry = {
1804- sessionFile : path . join ( tempDir , "next-rollover.jsonl" ) ,
1805- sessionId : "next-rollover" ,
1806- updatedAt : now + 1 ,
1807- } ;
1808- fs . writeFileSync ( previousTranscript , '{"type":"session","id":"previous-rollover"}\n' , "utf-8" ) ;
1809- await upsertSessionEntry ( { sessionKey, storePath } , previousEntry ) ;
1810- await upsertSessionEntry (
1811- { sessionKey : retiredKey , storePath } ,
1812- {
1813- lastChannel : "telegram" ,
1814- lastTo : "user" ,
1815- sessionId : "legacy-main" ,
1816- updatedAt : now ,
1817- } ,
1818- ) ;
1819-
1820- const result = await persistSessionRolloverLifecycle ( {
1821- activeSessionKey : sessionKey ,
1822- agentId : "main" ,
1823- previousEntry,
1824- retiredEntry : {
1825- key : retiredKey ,
1826- entry : {
1827- sessionId : "legacy-main" ,
1828- updatedAt : now ,
1829- } ,
1830- } ,
1831- sessionEntry : nextEntry ,
1832- sessionKey,
1833- storePath,
1834- } ) ;
1835-
1836- expect ( result . sessionEntry ) . toMatchObject ( nextEntry ) ;
1837- expect ( result . previousSessionTranscript . transcriptArchived ) . toBe ( true ) ;
1838- expect ( result . previousSessionTranscript . sessionFile ) . toContain (
1839- "previous-rollover.jsonl.reset." ,
1840- ) ;
1841- expect ( loadSessionEntry ( { sessionKey, storePath } ) ) . toMatchObject ( nextEntry ) ;
1842- expect ( loadSessionEntry ( { sessionKey : retiredKey , storePath } ) ) . toEqual ( {
1843- sessionId : "legacy-main" ,
1844- updatedAt : expect . any ( Number ) ,
1845- } ) ;
1846- expect ( fs . existsSync ( previousTranscript ) ) . toBe ( false ) ;
1847- expect ( fs . existsSync ( result . previousSessionTranscript . sessionFile ?? "" ) ) . toBe ( true ) ;
1848- } ) ;
1849-
18501792 it ( "appends transcript events through a session scope" , async ( ) => {
18511793 const scope = {
18521794 sessionFile : transcriptPath ,
0 commit comments