Browse Source

fix: reset the variable `isWaitingForFirstChunk` when catch exception (#3262)

Liu Wei 10 months ago
parent
commit
a715ec723a
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/core/Cline.ts

+ 1 - 0
src/core/Cline.ts

@@ -1515,6 +1515,7 @@ export class Cline extends EventEmitter<ClineEvents> {
 			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