fix(retry): recognize ZhiPu 1302 rate-limit error for retry

ZhiPu API returns code 1302 with Chinese text "速率限制" instead of
standard HTTP 429 + "rate limit", causing the retry engine to treat
it as non-transient and fail immediately.
This commit is contained in:
chengyongru
2026-04-21 21:23:20 +08:00
committed by Xubin Ren
parent 1b692debdc
commit 37ea8b8f5b
2 changed files with 52 additions and 0 deletions
+2
View File
@@ -108,6 +108,7 @@ class LLMProvider(ABC):
"connection",
"server error",
"temporarily unavailable",
"速率限制",
)
_RETRYABLE_STATUS_CODES = frozenset({408, 409, 429})
_TRANSIENT_ERROR_KINDS = frozenset({"timeout", "connection"})
@@ -154,6 +155,7 @@ class LLMProvider(ABC):
"temporarily unavailable",
"overloaded",
"concurrency limit",
"速率限制",
)
_SENTINEL = object()