From cca4165f5f383e67572661b8bdf9951610f8d0c0 Mon Sep 17 00:00:00 2001 From: Jijun Leng <962285+jjleng@users.noreply.github.com> Date: Tue, 8 Apr 2025 16:34:17 -0700 Subject: [PATCH] feat: mark pending tools as failed on stream end --- cp-webapp/src/hooks/use-chat-stream.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cp-webapp/src/hooks/use-chat-stream.ts b/cp-webapp/src/hooks/use-chat-stream.ts index de7cc74..3aeb0d3 100644 --- a/cp-webapp/src/hooks/use-chat-stream.ts +++ b/cp-webapp/src/hooks/use-chat-stream.ts @@ -556,6 +556,8 @@ export function useChatStream() { } } finally { cleanupThinking(); + // Mark any tools still in 'started' state as 'failed' when the stream ends + markPendingToolsAsFailed(); setIsStreaming(false); setAbortController(null);