@@ -1668,6 +1668,39 @@ describe('FullCompaction', () => {
16681668 ` ) ;
16691669 await ctx . expectResumeMatches ( ) ;
16701670 } ) ;
1671+
1672+ it ( 'appends the todo list to the compaction summary' , async ( ) => {
1673+ const ctx = testAgent ( ) ;
1674+ ctx . configure ( {
1675+ provider : CATALOGUED_PROVIDER ,
1676+ modelCapabilities : CATALOGUED_MODEL_CAPABILITIES ,
1677+ } ) ;
1678+ ctx . appendExchange ( 1 , 'old user one' , 'old assistant one' , 20 ) ;
1679+ ctx . appendExchange ( 2 , 'recent user two' , 'recent assistant two' , 80 ) ;
1680+
1681+ ctx . agent . tools . updateStore ( 'todo' , [
1682+ { title : 'Fix the auth bug' , status : 'in_progress' } ,
1683+ { title : 'Add tests' , status : 'pending' } ,
1684+ ] ) ;
1685+
1686+ const compacted = new Promise < void > ( ( resolve ) => {
1687+ ctx . emitter . once ( 'context.apply_compaction' , ( ) => {
1688+ resolve ( ) ;
1689+ } ) ;
1690+ } ) ;
1691+
1692+ ctx . mockNextResponse ( { type : 'text' , text : 'Compacted summary.' } ) ;
1693+ await ctx . rpc . beginCompaction ( { } ) ;
1694+ await compacted ;
1695+
1696+ const history = ctx . compactHistory ( ) ;
1697+ expect ( history ) . toHaveLength ( 1 ) ;
1698+ expect ( history [ 0 ] ) . toMatchObject ( {
1699+ role : 'assistant' ,
1700+ text : 'Compacted summary.\n\n## TODO List\n [in_progress] Fix the auth bug\n [pending] Add tests' ,
1701+ } ) ;
1702+ await ctx . expectResumeMatches ( ) ;
1703+ } ) ;
16711704} ) ;
16721705
16731706afterEach ( ( ) => {
0 commit comments