@@ -83,7 +83,7 @@ describe('context-pruner handleSteps', () => {
8383 ) : [ Message , ToolMessage ] =>
8484 createToolCallPair ( toolCallId , toolName , { } , { data : largeData } )
8585
86- const runHandleSteps = ( messages : Message [ ] ) => {
86+ const runHandleSteps = ( messages : Message [ ] , maxContextLength ?: number ) => {
8787 mockAgentState . messageHistory = messages
8888 const mockLogger = {
8989 debug : ( ) => { } ,
@@ -94,6 +94,7 @@ describe('context-pruner handleSteps', () => {
9494 const generator = contextPruner . handleSteps ! ( {
9595 agentState : mockAgentState ,
9696 logger : mockLogger ,
97+ params : maxContextLength ? { maxContextLength } : { } ,
9798 } )
9899 const results : any [ ] = [ ]
99100 let result = generator . next ( )
@@ -818,10 +819,10 @@ describe('context-pruner saved run state overflow', () => {
818819 console . log ( 'Initial tokens (approx):' , initialTokens )
819820
820821 // Run context-pruner with 100k limit
821- const mockAgentState = {
822+ const mockAgentState : any = {
822823 messageHistory : initialMessages ,
823824 systemPrompt : savedRunState . sessionState ?. mainAgentState ?. systemPrompt ,
824- } as AgentState
825+ }
825826 const mockLogger = {
826827 debug : ( ) => { } ,
827828 info : ( ) => { } ,
@@ -897,10 +898,10 @@ describe('context-pruner saved run state overflow', () => {
897898
898899 // Run context-pruner with 200k limit - must include systemPrompt in agentState
899900 // so the pruner knows about the extra tokens from the system prompt
900- const mockAgentState = {
901+ const mockAgentState : any = {
901902 messageHistory : initialMessages ,
902903 systemPrompt : systemPrompt ,
903- } as AgentState
904+ }
904905 const mockLogger = {
905906 debug : ( ) => { } ,
906907 info : ( ) => { } ,
@@ -1725,7 +1726,7 @@ describe('context-pruner PASS 0 instructions removal', () => {
17251726 test ( 'keeps only last INSTRUCTIONS_PROMPT when pruning passes run (over token limit)' , ( ) => {
17261727 // Use a lower maxContextLength to trigger pruning without needing massive content
17271728 // This ensures PASS 0.5 runs (past the initial check)
1728- const mockAgentState = {
1729+ const mockAgentState : any = {
17291730 messageHistory : [ ] as Message [ ] ,
17301731 }
17311732
0 commit comments