@@ -294,9 +294,8 @@ describe('context-pruner handleSteps', () => {
294294
295295 // Should use a memory artifact format, not transcript role markers
296296 expect ( content ) . toContain ( '<historical_memory>' )
297- expect ( content ) . toContain ( 'User request: ' )
297+ expect ( content ) . toContain ( '[USER] ' )
298298 expect ( content ) . toContain ( 'Progress note:' )
299- expect ( content ) . not . toContain ( '[USER]' )
300299 expect ( content ) . not . toContain ( '[ASSISTANT]' )
301300 } )
302301
@@ -321,8 +320,8 @@ describe('context-pruner handleSteps', () => {
321320 const content = results [ 0 ] . input . messages [ 0 ] . content [ 0 ] . text
322321
323322 // Should contain tool summaries
324- expect ( content ) . toContain ( 'Previously inspected files: file1.ts, file2.ts' )
325- expect ( content ) . toContain ( 'Previously edited file: file1.ts' )
323+ expect ( content ) . toContain ( 'inspected files: file1.ts, file2.ts' )
324+ expect ( content ) . toContain ( 'edited file: file1.ts' )
326325 } )
327326
328327 test ( 'summarizes various tool types correctly' , ( ) => {
@@ -350,10 +349,10 @@ describe('context-pruner handleSteps', () => {
350349 const results = runHandleSteps ( messages , 50000 , 10000 )
351350 const content = results [ 0 ] . input . messages [ 0 ] . content [ 0 ] . text
352351
353- expect ( content ) . toContain ( 'Previously wrote file: new-file.ts' )
354- expect ( content ) . toContain ( 'Previously ran command: npm test' )
355- expect ( content ) . toContain ( 'Previous code search for "function"' )
356- expect ( content ) . toContain ( 'Previously delegated agents:' )
352+ expect ( content ) . toContain ( 'wrote file: new-file.ts' )
353+ expect ( content ) . toContain ( 'ran command: npm test' )
354+ expect ( content ) . toContain ( 'code search for "function"' )
355+ expect ( content ) . toContain ( 'delegated agents:' )
357356 expect ( content ) . toContain ( '- file-picker' )
358357 expect ( content ) . toContain ( '- commander' )
359358 } )
@@ -387,7 +386,7 @@ describe('context-pruner handleSteps', () => {
387386 const results = runHandleSteps ( messages , 50000 , 10000 )
388387 const content = results [ 0 ] . input . messages [ 0 ] . content [ 0 ] . text
389388
390- expect ( content ) . toContain ( 'User request [image(s) were attached]: ' )
389+ expect ( content ) . toContain ( '[USER] [image(s) were attached]' )
391390 } )
392391
393392 test ( 'removes only INSTRUCTIONS_PROMPT and SUBAGENT_SPAWN when under context limit' , ( ) => {
@@ -569,7 +568,7 @@ describe('context-pruner handleSteps', () => {
569568 . text
570569 expect ( summaryContent ) . toContain ( 'PLEASE FIX THE BUG' )
571570 expect ( summaryContent ) . toContain ( 'I found the likely issue.' )
572- expect ( summaryContent ) . toContain ( 'Previously inspected files: src/bug.ts' )
571+ expect ( summaryContent ) . toContain ( 'inspected files: src/bug.ts' )
573572
574573 expect ( resultMessages [ 1 ] . role ) . toBe ( 'user' )
575574 expect ( resultMessages [ 1 ] . tags ) . toBeUndefined ( )
@@ -653,7 +652,7 @@ describe('context-pruner handleSteps', () => {
653652 const results = runHandleSteps ( messages , 50000 , 10000 )
654653 const content = results [ 0 ] . input . messages [ 0 ] . content [ 0 ] . text
655654
656- expect ( content ) . toContain ( 'Previously delegated agent file-picker' )
655+ expect ( content ) . toContain ( 'delegated agent file-picker' )
657656 } )
658657
659658 test ( 'handles long terminal commands by truncating' , ( ) => {
@@ -672,7 +671,7 @@ describe('context-pruner handleSteps', () => {
672671
673672 // Should truncate to 50 chars + ...
674673 expect ( content ) . toContain (
675- 'Previously ran command: npm run build -- --config=production --verbose --o...' ,
674+ 'ran command: npm run build -- --config=production --verbose --o...' ,
676675 )
677676 } )
678677
@@ -686,7 +685,7 @@ describe('context-pruner handleSteps', () => {
686685 const results = runHandleSteps ( messages , 50000 , 10000 )
687686 const content = results [ 0 ] . input . messages [ 0 ] . content [ 0 ] . text
688687
689- expect ( content ) . toContain ( 'Previously used tool unknown_tool_name' )
688+ expect ( content ) . toContain ( 'used tool unknown_tool_name' )
690689 } )
691690
692691 test ( 'handles multiple tool calls in single assistant message' , ( ) => {
@@ -719,8 +718,8 @@ describe('context-pruner handleSteps', () => {
719718 const content = results [ 0 ] . input . messages [ 0 ] . content [ 0 ] . text
720719
721720 // Both tool calls should be in the summary
722- expect ( content ) . toContain ( 'Previously inspected files: a.ts' )
723- expect ( content ) . toContain ( 'Previously inspected files: b.ts' )
721+ expect ( content ) . toContain ( 'inspected files: a.ts' )
722+ expect ( content ) . toContain ( 'inspected files: b.ts' )
724723 } )
725724
726725 test ( 'handles mixed text and tool calls in assistant message' , ( ) => {
@@ -748,7 +747,7 @@ describe('context-pruner handleSteps', () => {
748747
749748 // Should have both text and tool summary
750749 expect ( content ) . toContain ( 'Let me read that file for you' )
751- expect ( content ) . toContain ( 'Previously inspected files: test.ts' )
750+ expect ( content ) . toContain ( 'inspected files: test.ts' )
752751 } )
753752} )
754753
@@ -893,7 +892,7 @@ describe('context-pruner code_search with flags', () => {
893892 const content = results [ 0 ] . input . messages [ 0 ] . content [ 0 ] . text
894893
895894 expect ( content ) . toContain (
896- 'Previous code search for "myFunction" (-g *.ts -i)' ,
895+ 'code search for "myFunction" (-g *.ts -i)' ,
897896 )
898897 } )
899898} )
@@ -1775,7 +1774,7 @@ describe('context-pruner str_replace and write_file tool results', () => {
17751774 const content = results [ 0 ] . input . messages [ 0 ] . content [ 0 ] . text
17761775
17771776 // Should have both the tool call summary and the full result
1778- expect ( content ) . toContain ( 'Previously edited file: src/file.ts' )
1777+ expect ( content ) . toContain ( 'edited file: src/file.ts' )
17791778 expect ( content ) . toContain ( 'Edit result from str_replace:' )
17801779 expect ( content ) . toContain ( 'errorMessage' )
17811780 expect ( content ) . toContain ( 'No match found for old string' )
@@ -1826,7 +1825,7 @@ describe('context-pruner glob and list_directory tools', () => {
18261825 const results = runHandleSteps ( messages )
18271826 const content = results [ 0 ] . input . messages [ 0 ] . content [ 0 ] . text
18281827
1829- expect ( content ) . toContain ( 'Previous glob search for **/*.ts' )
1828+ expect ( content ) . toContain ( 'glob search for **/*.ts' )
18301829 } )
18311830
18321831 test ( 'summarizes list_directory tool with path' , ( ) => {
@@ -1841,7 +1840,7 @@ describe('context-pruner glob and list_directory tools', () => {
18411840 const results = runHandleSteps ( messages )
18421841 const content = results [ 0 ] . input . messages [ 0 ] . content [ 0 ] . text
18431842
1844- expect ( content ) . toContain ( 'Previously listed directory: src' )
1843+ expect ( content ) . toContain ( 'listed directory: src' )
18451844 } )
18461845
18471846 test ( 'summarizes read_subtree tool with paths' , ( ) => {
@@ -1857,7 +1856,7 @@ describe('context-pruner glob and list_directory tools', () => {
18571856 const content = results [ 0 ] . input . messages [ 0 ] . content [ 0 ] . text
18581857
18591858 expect ( content ) . toContain (
1860- 'Previously inspected subtrees: src/components, src/utils' ,
1859+ 'inspected subtrees: src/components, src/utils' ,
18611860 )
18621861 } )
18631862} )
@@ -2357,10 +2356,10 @@ describe('context-pruner dual-budget behavior', () => {
23572356
23582357 // === Tool call summaries present ===
23592358 expect ( content ) . toContain (
2360- 'Previously inspected files: src/model.ts, src/service.ts' ,
2359+ 'inspected files: src/model.ts, src/service.ts' ,
23612360 )
2362- expect ( content ) . toContain ( 'Previously edited file: src/model.ts' )
2363- expect ( content ) . toContain ( 'Previously delegated agents:' )
2361+ expect ( content ) . toContain ( 'edited file: src/model.ts' )
2362+ expect ( content ) . toContain ( 'delegated agents:' )
23642363
23652364 // === str_replace result: present but truncated at 2k chars ===
23662365 expect ( content ) . toContain ( 'Edit result from str_replace:' )
0 commit comments