fix: ensure the alibaba provider errors are retried (#21355)

This commit is contained in:
Aiden Cline
2026-04-07 12:46:01 -05:00
committed by GitHub
parent 2549a38a71
commit 81bdffc81c
2 changed files with 32 additions and 0 deletions

View File

@@ -58,6 +58,19 @@ export namespace SessionRetry {
return error.data.message.includes("Overloaded") ? "Provider is overloaded" : error.data.message
}
// Check for rate limit patterns in plain text error messages
const msg = error.data?.message
if (typeof msg === "string") {
const lower = msg.toLowerCase()
if (
lower.includes("rate increased too quickly") ||
lower.includes("rate limit") ||
lower.includes("too many requests")
) {
return msg
}
}
const json = iife(() => {
try {
if (typeof error.data?.message === "string") {