@@ -1598,6 +1598,42 @@ describe("ChatView timeline estimator parity (full app)", () => {
15981598 }
15991599 } ) ;
16001600
1601+ it ( "includes the active turn id when stopping a running turn" , async ( ) => {
1602+ wsRequests . length = 0 ;
1603+
1604+ const mounted = await mountChatView ( {
1605+ viewport : DEFAULT_VIEWPORT ,
1606+ snapshot : createSnapshotForTargetUser ( {
1607+ targetMessageId : "msg-user-stop-button-turn-id" as MessageId ,
1608+ targetText : "stop button turn id target" ,
1609+ sessionStatus : "running" ,
1610+ activeTurnId : "turn-stop-button-turn-id" as TurnId ,
1611+ } ) ,
1612+ } ) ;
1613+
1614+ try {
1615+ const stopButton = await waitForElement (
1616+ ( ) => document . querySelector < HTMLButtonElement > ( 'button[aria-label="Stop generation"]' ) ,
1617+ "Unable to find stop generation button." ,
1618+ ) ;
1619+
1620+ stopButton . click ( ) ;
1621+
1622+ await vi . waitFor (
1623+ ( ) =>
1624+ wsRequests . some (
1625+ ( request ) =>
1626+ request . _tag === ORCHESTRATION_WS_METHODS . dispatchCommand &&
1627+ request . type === "thread.turn.interrupt" &&
1628+ request . turnId === "turn-stop-button-turn-id" ,
1629+ ) ,
1630+ { timeout : 8_000 , interval : 16 } ,
1631+ ) ;
1632+ } finally {
1633+ await mounted . cleanup ( ) ;
1634+ }
1635+ } ) ;
1636+
16011637 it ( "keeps the new thread selected after clicking the new-thread button" , async ( ) => {
16021638 const mounted = await mountChatView ( {
16031639 viewport : DEFAULT_VIEWPORT ,
0 commit comments