From ea44011d152e6140b5732b72d0700c7ecc59c4d1 Mon Sep 17 00:00:00 2001 From: asill-livestream Date: Thu, 4 Jun 2026 16:11:51 +0900 Subject: [PATCH] fix(desktop): prevent thinking block from closing mid-streaming MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When reasoning text grows during streaming, new parts can be appended beyond endIndex. The pending check used slice(startIndex, endIndex) which excluded these new parts — if the original part completed, the block would close while new reasoning was still streaming. Fix: remove the endIndex cap from slice() so all parts from startIndex onward are checked. During non-streaming, the array is stable and all parts are within range anyway. --- apps/desktop/src/components/assistant-ui/thread.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/desktop/src/components/assistant-ui/thread.tsx b/apps/desktop/src/components/assistant-ui/thread.tsx index 513aaabca..96c0b71a5 100644 --- a/apps/desktop/src/components/assistant-ui/thread.tsx +++ b/apps/desktop/src/components/assistant-ui/thread.tsx @@ -438,7 +438,7 @@ const ReasoningAccordionGroup: FC<{ children?: ReactNode; endIndex: number; star s.thread.isRunning && s.message.status?.type === 'running' && s.message.parts - .slice(Math.max(0, startIndex), Math.min(s.message.parts.length, endIndex)) + .slice(Math.max(0, startIndex)) .some(p => p?.type === 'reasoning' && p.status?.type !== 'complete') )