retry anthropic overloaded errors

This commit is contained in:
Dax Raad
2025-11-25 15:44:24 -05:00
parent 5f35c579e2
commit 9eabbe2e76
3 changed files with 35 additions and 33 deletions

View File

@@ -333,9 +333,9 @@ export namespace SessionProcessor {
error: e,
})
const error = MessageV2.fromError(e, { providerID: input.providerID })
if (error?.name === "APIError" && error.data.isRetryable) {
if ((error?.name === "APIError" && error.data.isRetryable) || error.data.message.includes("Overloaded")) {
attempt++
const delay = SessionRetry.delay(error, attempt)
const delay = SessionRetry.delay(attempt, error.name === "APIError" ? error : undefined)
SessionStatus.set(input.sessionID, {
type: "retry",
attempt,