@@ -828,25 +828,32 @@ describe("deriveMessagesTimelineRows", () => {
828828 message : "Skipped compaction to send a queued message" ,
829829 } ,
830830 } ;
831- const rows = deriveMessagesTimelineRows ( {
832- timelineEntries : deriveTimelineEntriesFromVisibleTurnItems ( {
833- visibleTurnItems : [ history0 ! , history1 ! , history2 ! , prompt , compaction , interruptResult ] ,
834- optimisticMessages : [ ] ,
835- } ) ,
836- isWorking : false ,
837- latestRun : {
838- runId : fixture . runId ,
839- status : "interrupted" ,
840- startedAt : fixture . time ( 5 ) ,
841- completedAt : fixture . time ( 9 ) ,
842- } ,
843- turnDiffSummaries : [ ] ,
844- supportsConversationRollback : false ,
845- } ) ;
831+ const liveRowsFor = ( visibleTurnItems : OrchestrationV2ProjectedTurnItem [ ] ) => {
832+ const rows = deriveMessagesTimelineRows ( {
833+ timelineEntries : deriveTimelineEntriesFromVisibleTurnItems ( {
834+ visibleTurnItems : [ history0 ! , history1 ! , history2 ! , ...visibleTurnItems ] ,
835+ optimisticMessages : [ ] ,
836+ } ) ,
837+ isWorking : false ,
838+ latestRun : {
839+ runId : fixture . runId ,
840+ status : "interrupted" ,
841+ startedAt : fixture . time ( 5 ) ,
842+ completedAt : fixture . time ( 9 ) ,
843+ } ,
844+ turnDiffSummaries : [ ] ,
845+ supportsConversationRollback : false ,
846+ } ) ;
847+ return rows . slice ( rows . findIndex ( ( row ) => row . id . includes ( "history-assistant" ) ) + 1 ) ;
848+ } ;
846849
847- expect (
848- rows . slice ( rows . findIndex ( ( row ) => row . id . includes ( "history-assistant" ) ) + 1 ) ,
849- ) . toMatchObject ( [ { kind : "context-compaction" , label : "Context compaction stopped" } ] ) ;
850+ expect ( liveRowsFor ( [ prompt , compaction , interruptResult ] ) ) . toMatchObject ( [
851+ { kind : "context-compaction" , label : "Context compaction stopped" } ,
852+ ] ) ;
853+ // Stopped before the provider started: no compaction row says so, so the interrupt stays.
854+ expect ( liveRowsFor ( [ prompt , interruptResult ] ) . map ( ( row ) => row . id ) ) . toContain (
855+ "interrupt-result" ,
856+ ) ;
850857 } ) ;
851858
852859 it ( "only enables assistant copy for the terminal assistant message in a turn" , ( ) => {
0 commit comments