Date: Tue, 7 Jan 2025 10:34:49 -0500
Subject: [PATCH 3/4] 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 && (
From f7a98c7f51132af52a3fdfeeaab86046fadb91c9 Mon Sep 17 00:00:00 2001
From: Matt Rubens
Date: Tue, 7 Jan 2025 10:37:12 -0500
Subject: [PATCH 4/4] Release
---
.changeset/slow-ladybugs-invite.md | 5 +++++
README.md | 1 +
2 files changed, 6 insertions(+)
create mode 100644 .changeset/slow-ladybugs-invite.md
diff --git a/.changeset/slow-ladybugs-invite.md b/.changeset/slow-ladybugs-invite.md
new file mode 100644
index 0000000..eca059e
--- /dev/null
+++ b/.changeset/slow-ladybugs-invite.md
@@ -0,0 +1,5 @@
+---
+"roo-cline": patch
+---
+
+Automatically retry failed API requests with a configurable delay (thanks @RaySinner!)
diff --git a/README.md b/README.md
index bf2a627..d067902 100644
--- a/README.md
+++ b/README.md
@@ -23,6 +23,7 @@ A fork of Cline, an autonomous coding agent, with some additional experimental f
- Per-tool MCP auto-approval
- Enable/disable individual MCP servers
- Enable/disable the MCP feature overall
+- Automatically retry failed API requests with a configurable delay
- Configurable delay after auto-writes to allow diagnostics to detect potential problems
- Control the number of terminal output lines to pass to the model when executing commands
- Runs alongside the original Cline