Skip to content

Commit 66566e2

Browse files
committed
fix(web): recover running turn when session turn id is missing
1 parent 25c7e35 commit 66566e2

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

‎apps/web/src/components/ChatView.tsx‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1758,11 +1758,8 @@ function ChatViewContent(props: ChatViewProps) {
17581758
}, [draftThreadKeys, openTerminalThreadKeys, serverThreadKeys]);
17591759
const activeLatestTurn = activeThread?.latestTurn ?? null;
17601760
const activeRunningTurnId =
1761-
activeThread?.session?.status === "running"
1762-
? activeThread.session.activeTurnId
1763-
: activeLatestTurn?.state === "running"
1764-
? activeLatestTurn.turnId
1765-
: null;
1761+
(activeThread?.session?.status === "running" ? activeThread.session.activeTurnId : null) ??
1762+
(activeLatestTurn?.state === "running" ? activeLatestTurn.turnId : null);
17661763
// Reading a finished thread clears the sidebar's Done badge. The visit is
17671764
// stamped at the turn's completion time — not now/updatedAt — so it clears
17681765
// exactly the completion the user is looking at: a wake or completion that

0 commit comments

Comments
 (0)