Преглед изворни кода

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

Liu Wei пре 7 месеци
родитељ
комит
a715ec723a
1 измењених фајлова са 1 додато и 0 уклоњено
  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