mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
feat: add server_error, rate_limit, and no_kv_space retry logic to accommodate Foundry API issues (#5527)
Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
This commit is contained in:
parent
6d412d8872
commit
92948ed8a4
1 changed files with 6 additions and 0 deletions
|
|
@ -68,6 +68,12 @@ export namespace SessionRetry {
|
|||
if (json.code === "Some resource has been exhausted") {
|
||||
return "Provider is overloaded"
|
||||
}
|
||||
if (json.type === "error" && json.error?.code?.includes("rate_limit")) {
|
||||
return "Rate Limited"
|
||||
}
|
||||
if (json.error?.message?.includes("no_kv_space") || (json.type === "error" && json.error?.type === "server_error")) {
|
||||
return "Provider Server Error"
|
||||
}
|
||||
} catch {}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue