@@ -12,12 +12,7 @@ import { toolResultErrored } from "./eval-turn";
1212
1313type Messages = Parameters < typeof extractToolActivity > [ 0 ] ;
1414
15- function turn (
16- toolName : string ,
17- input : unknown ,
18- output : unknown ,
19- toolCallId = "tc1"
20- ) : Messages {
15+ function turn ( toolName : string , input : unknown , output : unknown , toolCallId = "tc1" ) : Messages {
2116 return [
2217 { role : "assistant" , content : [ { type : "tool-call" , toolCallId, toolName, input } ] } ,
2318 { role : "tool" , content : [ { type : "tool-result" , toolCallId, toolName, output } ] } ,
@@ -106,10 +101,19 @@ describe("the eval judge payload's size", () => {
106101 it ( "caps a nine-step turn below the aggregate limit" , ( ) => {
107102 const messages : Messages = [ ] ;
108103 for ( let step = 0 ; step < 9 ; step ++ ) {
109- messages . push ( ...turn ( "get_run_trace" , { runId : `run_${ step } ` } , {
110- type : "json" ,
111- value : { spans : Array . from ( { length : 200 } , ( ) => ( { attributes : { body : "q" . repeat ( 50 ) } } ) ) } ,
112- } , `tc${ step } ` ) ) ;
104+ messages . push (
105+ ...turn (
106+ "get_run_trace" ,
107+ { runId : `run_${ step } ` } ,
108+ {
109+ type : "json" ,
110+ value : {
111+ spans : Array . from ( { length : 200 } , ( ) => ( { attributes : { body : "q" . repeat ( 50 ) } } ) ) ,
112+ } ,
113+ } ,
114+ `tc${ step } `
115+ )
116+ ) ;
113117 }
114118
115119 const activity = extractToolActivity ( messages ) ;
@@ -133,10 +137,14 @@ describe("an errored tool result", () => {
133137
134138 it ( "still reads as an error after redaction" , ( ) => {
135139 const activity = extractToolActivity (
136- turn ( "run_query" , { runId : "run_1" } , {
137- type : "error-text" ,
138- value : "boom on alice@example.com" ,
139- } )
140+ turn (
141+ "run_query" ,
142+ { runId : "run_1" } ,
143+ {
144+ type : "error-text" ,
145+ value : "boom on alice@example.com" ,
146+ }
147+ )
140148 ) ;
141149
142150 expect ( JSON . stringify ( activity ) ) . not . toContain ( "alice@example.com" ) ;
0 commit comments