Make retries respect the global auto approve checkbox (#3067)

This commit is contained in:
Matt Rubens 2025-04-30 11:31:10 -04:00 committed by GitHub
parent 506719018b
commit 6e86f04a74
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -930,7 +930,7 @@ export class Cline extends EventEmitter<ClineEvents> {
async *attemptApiRequest(previousApiReqIndex: number, retryAttempt: number = 0): ApiStream {
let mcpHub: McpHub | undefined
const { apiConfiguration, mcpEnabled, alwaysApproveResubmit, requestDelaySeconds } =
const { apiConfiguration, mcpEnabled, autoApprovalEnabled, alwaysApproveResubmit, requestDelaySeconds } =
(await this.providerRef.deref()?.getState()) ?? {}
let rateLimitDelay = 0
@ -1093,7 +1093,7 @@ export class Cline extends EventEmitter<ClineEvents> {
this.isWaitingForFirstChunk = false
} catch (error) {
// 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 (alwaysApproveResubmit) {
if (autoApprovalEnabled && alwaysApproveResubmit) {
let errorMsg
if (error.error?.metadata?.raw) {