Skip to content

Commit eeda785

Browse files
committed
Update exponential backoff to retry faster
#850 Old backoff: 5 10 20 40 80 New backoff: - First 3 attempts: 5 second delay - 4th attempt: ~5.06 second delay - 5th attempt: ~7.59 second delay - 6th attempt: ~11.39 second delay
1 parent 28cdf0e commit eeda785

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/core/Cline.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ export class Cline {
10121012
if (alwaysApproveResubmit) {
10131013
const errorMsg = error.error?.metadata?.raw ?? error.message ?? "Unknown error"
10141014
const baseDelay = requestDelaySeconds || 5
1015-
const exponentialDelay = Math.ceil(baseDelay * Math.pow(2, retryAttempt))
1015+
const exponentialDelay = Math.max(baseDelay, Math.pow(1.5, retryAttempt))
10161016
// Wait for the greater of the exponential delay or the rate limit delay
10171017
const finalDelay = Math.max(exponentialDelay, rateLimitDelay)
10181018

0 commit comments

Comments
 (0)