mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
tweak: more retry cases
This commit is contained in:
parent
606cf3b6f2
commit
ecc5050838
1 changed files with 3 additions and 2 deletions
|
|
@ -65,7 +65,7 @@ export namespace SessionRetry {
|
|||
if (json.type === "error" && json.error?.type === "too_many_requests") {
|
||||
return "Too Many Requests"
|
||||
}
|
||||
if (json.code === "Some resource has been exhausted") {
|
||||
if (json.code.includes("exhausted") || json.code.includes("unavailable")) {
|
||||
return "Provider is overloaded"
|
||||
}
|
||||
if (json.type === "error" && json.error?.code?.includes("rate_limit")) {
|
||||
|
|
@ -73,7 +73,8 @@ export namespace SessionRetry {
|
|||
}
|
||||
if (
|
||||
json.error?.message?.includes("no_kv_space") ||
|
||||
(json.type === "error" && json.error?.type === "server_error")
|
||||
(json.type === "error" && json.error?.type === "server_error") ||
|
||||
!!json.error
|
||||
) {
|
||||
return "Provider Server Error"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue