Skip to content

Commit b8d76f9

Browse files
committed
address comments
1 parent f6ab790 commit b8d76f9

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

apps/sim/app/workspace/[workspaceId]/home/hooks/use-chat.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3694,7 +3694,7 @@ export function useChat(
36943694
shouldContinue: isSameRecoverySubject,
36953695
})
36963696
if (!succeeded && streamGenRef.current === recoveryGen && isSameRecoverySubject()) {
3697-
finalizeRef.current({ error: true })
3697+
finalizeRef.current({ error: true, targetChatId: chatId })
36983698
}
36993699
}
37003700
})()

apps/sim/hooks/use-task-events.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ function isLocalOptimisticActiveStream(current: TaskChatHistory | undefined) {
3333
return current.messages.some((message) => message.id === liveAssistantId)
3434
}
3535

36+
/**
37+
* Returns true when the cached active stream is known to be later in the
38+
* chronological transcript than the stream that emitted this status event.
39+
* If either stream is absent from the transcript, callers should refetch
40+
* instead of inferring order from incomplete cache state.
41+
*/
3642
function hasNewerKnownActiveStream(current: TaskChatHistory | undefined, streamId: string) {
3743
if (!current?.activeStreamId || current.activeStreamId === streamId) return false
3844

0 commit comments

Comments
 (0)