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

This commit is contained in:
Liu Wei 2025-05-08 11:15:31 +08:00 • committed by GitHub
parent 12552d21b8
commit a715ec723a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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