@@ -1166,73 +1166,6 @@ it("accepts ready attachment-only answers while preserving selected options", ()
11661166 ) . toBeNull ( ) ;
11671167} ) ;
11681168
1169- it . each ( [ false , true ] ) ( "caps a live approval header with preceding work: %s" , ( precedingWork ) => {
1170- const at = "2026-06-20T00:00:03.000Z" ;
1171- const prompt = `python3 - <<'PY'\n${ "print('ok')\n" . repeat ( 400 ) } PY` ;
1172- const approval : OrchestrationV2TurnItem = {
1173- ...base ( "approval" , at , 2 ) ,
1174- type : "approval_request" ,
1175- status : "waiting" ,
1176- completedAt : null ,
1177- requestId : RuntimeRequestId . make ( "approval" ) ,
1178- requestKind : "command" ,
1179- prompt,
1180- } ;
1181- const presented = deriveThreadFeedPresentation (
1182- buildThreadFeed (
1183- [ userMessage ( ) , ...( precedingWork ? [ command ( ) ] : [ ] ) , approval ] . map ( ( item , position ) =>
1184- projected ( item , position ) ,
1185- ) ,
1186- ) ,
1187- { runId, status : "running" , startedAt : at , completedAt : null } ,
1188- new Set ( ) ,
1189- new Set ( ) ,
1190- at ,
1191- ) ;
1192- const row = presented . find ( ( entry ) =>
1193- precedingWork ? entry . type === "work-toggle" : entry . type === "activity-group" ,
1194- ) ;
1195- const label =
1196- row ?. type === "work-toggle"
1197- ? row . summary
1198- : row ?. type === "activity-group"
1199- ? row . activities [ 0 ] ?. groupStandIn ?. label
1200- : undefined ;
1201- expect ( label ) . toBeDefined ( ) ;
1202- expect ( label ?. length ) . toBeLessThanOrEqual ( 203 ) ;
1203- expect ( label ) . toMatch ( / ^ p y t h o n 3 - < < ' P Y ' p r i n t \( ' o k ' \) / ) ;
1204- const activity = buildThreadFeed ( [ projected ( approval , 0 ) ] ) [ 0 ] ;
1205- if ( activity ?. type !== "activity-group" ) throw new Error ( "Expected approval activity" ) ;
1206- expect ( activity . activities [ 0 ] ?. detail ) . toBe ( prompt ) ;
1207- expect ( activity . activities [ 0 ] ?. getCopyText ( ) ) . toContain ( prompt ) ;
1208- } ) ;
1209-
1210- it ( "caps a live thought preview while preserving the full reasoning" , ( ) => {
1211- const at = "2026-06-20T00:00:02.000Z" ;
1212- const text = "Reviewing the pending command\n" . repeat ( 100 ) ;
1213- const reasoning : OrchestrationV2TurnItem = {
1214- ...base ( "reasoning" , at , 1 ) ,
1215- type : "reasoning" ,
1216- status : "running" ,
1217- completedAt : null ,
1218- streaming : true ,
1219- text,
1220- } ;
1221- const feed = buildThreadFeed ( [ projected ( userMessage ( ) , 0 ) , projected ( reasoning , 1 ) ] ) ;
1222- const rows = deriveThreadFeedPresentation (
1223- feed ,
1224- { runId, status : "running" , startedAt : at , completedAt : null } ,
1225- new Set ( ) ,
1226- new Set ( ) ,
1227- at ,
1228- ) ;
1229- const header = rows . find ( ( row ) => row . type === "work-toggle" ) ;
1230- expect ( header ?. thought ?. length ) . toBeLessThanOrEqual ( 203 ) ;
1231- expect ( header ?. thought ) . toMatch ( / ^ R e v i e w i n g t h e p e n d i n g c o m m a n d R e v i e w i n g / ) ;
1232- const activity = feed . find ( ( row ) => row . type === "activity-group" ) ;
1233- expect ( activity ?. activities [ 0 ] ?. detail ) . toBe ( text ) ;
1234- } ) ;
1235-
12361169it ( "stops stranded thinking after a steer and follows the next thought or tool" , ( ) => {
12371170 const at = "2026-06-20T00:00:02.000Z" ;
12381171 const thought = ( id : string ) : OrchestrationV2TurnItem => ( {
0 commit comments