Skip to content

Commit fe4f691

Browse files
committed
Update max retry delay to 600 since this is what's set by MAX_EXPONENTIAL_BACKOFF_SECONDS
1 parent fca3819 commit fe4f691

File tree

8 files changed

+12
-14
lines changed

8 files changed

+12
-14
lines changed

packages/types/src/global-settings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ export const EVALS_SETTINGS: RooCodeSettings = {
190190
alwaysAllowBrowser: true,
191191
alwaysApproveResubmit: true,
192192
requestDelaySeconds: 5,
193-
maxRequestDelaySeconds: 100,
193+
maxRequestDelaySeconds: 600,
194194
alwaysAllowMcp: true,
195195
alwaysAllowModeSwitch: true,
196196
alwaysAllowSubtasks: true,

src/core/task/Task.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1807,10 +1807,8 @@ export class Task extends EventEmitter<ClineEvents> {
18071807
const minDelay = requestDelaySeconds ?? 5
18081808
const maxDelay = maxRequestDelaySeconds ?? MAX_EXPONENTIAL_BACKOFF_SECONDS
18091809

1810-
// Use the minimum delay as the base for exponential backoff
18111810
let exponentialDelay = Math.ceil(minDelay * Math.pow(2, retryAttempt))
18121811

1813-
// Clamp exponential delay to the configured range
18141812
exponentialDelay = Math.max(minDelay, Math.min(exponentialDelay, maxDelay))
18151813

18161814
// If the error is a 429, and the error details contain a retry delay, use that delay instead of exponential backoff

src/core/webview/ClineProvider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,7 +1479,7 @@ export class ClineProvider
14791479
enableMcpServerCreation: enableMcpServerCreation ?? true,
14801480
alwaysApproveResubmit: alwaysApproveResubmit ?? false,
14811481
requestDelaySeconds: requestDelaySeconds ?? 5,
1482-
maxRequestDelaySeconds: maxRequestDelaySeconds ?? 100,
1482+
maxRequestDelaySeconds: maxRequestDelaySeconds ?? 600,
14831483
currentApiConfigName: currentApiConfigName ?? "default",
14841484
listApiConfigMeta: listApiConfigMeta ?? [],
14851485
pinnedApiConfigs: pinnedApiConfigs ?? {},
@@ -1644,7 +1644,7 @@ export class ClineProvider
16441644
enableMcpServerCreation: stateValues.enableMcpServerCreation ?? true,
16451645
alwaysApproveResubmit: stateValues.alwaysApproveResubmit ?? false,
16461646
requestDelaySeconds: Math.max(1, stateValues.requestDelaySeconds ?? 5),
1647-
maxRequestDelaySeconds: Math.min(100, stateValues.maxRequestDelaySeconds ?? 100),
1647+
maxRequestDelaySeconds: Math.min(600, stateValues.maxRequestDelaySeconds ?? 600),
16481648
currentApiConfigName: stateValues.currentApiConfigName ?? "default",
16491649
listApiConfigMeta: stateValues.listApiConfigMeta ?? [],
16501650
pinnedApiConfigs: stateValues.pinnedApiConfigs ?? {},

src/core/webview/__tests__/ClineProvider.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ describe("ClineProvider", () => {
521521
mcpEnabled: true,
522522
enableMcpServerCreation: false,
523523
requestDelaySeconds: 5,
524-
maxRequestDelaySeconds: 100,
524+
maxRequestDelaySeconds: 600,
525525
mode: defaultModeSlug,
526526
customModes: [],
527527
experiments: experimentDefault,
@@ -814,7 +814,7 @@ describe("ClineProvider", () => {
814814
expect(state.requestDelaySeconds).toBe(5)
815815
})
816816

817-
test("maxRequestDelaySeconds defaults to 100 seconds", async () => {
817+
test("maxRequestDelaySeconds defaults to 600 seconds", async () => {
818818
// Mock globalState.get to return undefined for requestDelaySeconds
819819
;(mockContext.globalState.get as any).mockImplementation((key: string) => {
820820
if (key === "maxRequestDelaySeconds") {
@@ -824,7 +824,7 @@ describe("ClineProvider", () => {
824824
})
825825

826826
const state = await provider.getState()
827-
expect(state.maxRequestDelaySeconds).toBe(100)
827+
expect(state.maxRequestDelaySeconds).toBe(600)
828828
})
829829

830830
test("alwaysApproveResubmit defaults to false", async () => {
@@ -1021,8 +1021,8 @@ describe("ClineProvider", () => {
10211021
expect(mockPostMessage).toHaveBeenCalled()
10221022

10231023
// Test maxRequestDelaySeconds
1024-
await messageHandler({ type: "maxRequestDelaySeconds", value: 100 })
1025-
expect(mockContext.globalState.update).toHaveBeenCalledWith("maxRequestDelaySeconds", 100)
1024+
await messageHandler({ type: "maxRequestDelaySeconds", value: 600 })
1025+
expect(mockContext.globalState.update).toHaveBeenCalledWith("maxRequestDelaySeconds", 600)
10261026
expect(mockPostMessage).toHaveBeenCalled()
10271027
})
10281028

src/core/webview/webviewMessageHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ export const webviewMessageHandler = async (
863863
await provider.postStateToWebview()
864864
break
865865
case "maxRequestDelaySeconds":
866-
await updateGlobalState("maxRequestDelaySeconds", Math.max(1, message.value ?? 100))
866+
await updateGlobalState("maxRequestDelaySeconds", Math.max(1, message.value ?? 600))
867867
await provider.postStateToWebview()
868868
break
869869
case "writeDelayMs":

webview-ui/src/components/settings/AutoApproveSettings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export const AutoApproveSettings = ({
197197
<div className="flex items-center gap-2">
198198
<Slider
199199
min={1}
200-
max={100}
200+
max={600}
201201
step={1}
202202
value={[requestDelaySeconds, maxRequestDelaySeconds]}
203203
onValueChange={([min, max]) => {

webview-ui/src/context/ExtensionStateContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export const ExtensionStateContextProvider: React.FC<{ children: React.ReactNode
179179
enableMcpServerCreation: false,
180180
alwaysApproveResubmit: false,
181181
requestDelaySeconds: 5,
182-
maxRequestDelaySeconds: 100,
182+
maxRequestDelaySeconds: 600,
183183
currentApiConfigName: "default",
184184
listApiConfigMeta: [],
185185
mode: defaultModeSlug,

webview-ui/src/context/__tests__/ExtensionStateContext.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ describe("mergeExtensionState", () => {
191191
enableCheckpoints: true,
192192
writeDelayMs: 1000,
193193
requestDelaySeconds: 5,
194-
maxRequestDelaySeconds: 100,
194+
maxRequestDelaySeconds: 600,
195195
mode: "default",
196196
experiments: {} as Record<ExperimentId, boolean>,
197197
customModes: [],

0 commit comments

Comments
 (0)