From a715ec723a22e9397ab550119263698af64e1e04 Mon Sep 17 00:00:00 2001 From: Liu Wei <375636559@qq.com> Date: Thu, 8 May 2025 11:15:31 +0800 Subject: [PATCH] fix: reset the variable `isWaitingForFirstChunk` when catch exception (#3262) --- src/core/Cline.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/Cline.ts b/src/core/Cline.ts index fc7afe76b5..279176fbf2 100644 --- a/src/core/Cline.ts +++ b/src/core/Cline.ts @@ -1515,6 +1515,7 @@ export class Cline extends EventEmitter { yield firstChunk.value this.isWaitingForFirstChunk = false } catch (error) { + this.isWaitingForFirstChunk = false // note that this api_req_failed ask is unique in that we only present this option if the api hasn't streamed any content yet (ie it fails on the first chunk due), as it would allow them to hit a retry button. However if the api failed mid-stream, it could be in any arbitrary state where some tools may have executed, so that error is handled differently and requires cancelling the task entirely. if (autoApprovalEnabled && alwaysApproveResubmit) { let errorMsg