UI tweaks

This commit is contained in:
Matt Rubens
2025-01-07 10:34:49 -05:00
parent c9de9cda66
commit 0ff8fe45d4
2 changed files with 5 additions and 4 deletions

View File

@@ -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)

View File

@@ -370,10 +370,10 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
<VSCodeCheckbox
checked={alwaysApproveResubmit}
onChange={(e: any) => setAlwaysApproveResubmit(e.target.checked)}>
<span style={{ fontWeight: "500" }}>Always approve resubmit request</span>
<span style={{ fontWeight: "500" }}>Always retry failed API requests</span>
</VSCodeCheckbox>
<p style={{ fontSize: "12px", marginTop: "5px", color: "var(--vscode-descriptionForeground)" }}>
Automatically retry request when server returns an error response, with a configurable delay
Automatically retry failed API requests when server returns an error response
</p>
{alwaysApproveResubmit && (
<div style={{ marginTop: 10 }}>