From 0ff8fe45d4729a692529e4c8eb7b240c605594cb Mon Sep 17 00:00:00 2001 From: Matt Rubens Date: Tue, 7 Jan 2025 10:34:49 -0500 Subject: [PATCH] UI tweaks --- src/core/Cline.ts | 5 +++-- webview-ui/src/components/settings/SettingsView.tsx | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/Cline.ts b/src/core/Cline.ts index afbae37..e1ba0c1 100644 --- a/src/core/Cline.ts +++ b/src/core/Cline.ts @@ -811,6 +811,7 @@ export class Cline { } 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) { + const requestDelay = requestDelaySeconds || 5 // Automatically retry with delay await this.say( "error", @@ -823,10 +824,10 @@ export class Cline { : error.message?.includes("500") || error.message?.includes("503") ? "internal server error" : "unknown" - }). ↺ Retrying...`, + }). ↺ Retrying in ${requestDelay} seconds...`, ) await this.say("api_req_retry_delayed") - await delay((requestDelaySeconds || 5) * 1000) + await delay(requestDelay * 1000) await this.say("api_req_retried") // delegate generator output from the recursive call yield* this.attemptApiRequest(previousApiReqIndex) diff --git a/webview-ui/src/components/settings/SettingsView.tsx b/webview-ui/src/components/settings/SettingsView.tsx index d24bd49..956b76b 100644 --- a/webview-ui/src/components/settings/SettingsView.tsx +++ b/webview-ui/src/components/settings/SettingsView.tsx @@ -370,10 +370,10 @@ const SettingsView = ({ onDone }: SettingsViewProps) => { setAlwaysApproveResubmit(e.target.checked)}> - Always approve resubmit request + Always retry failed API requests

- Automatically retry request when server returns an error response, with a configurable delay + Automatically retry failed API requests when server returns an error response

{alwaysApproveResubmit && (