Repository navigation
Commit 416905b
committed
fix: classify HTTP 429 'temporarily overloaded' as overloaded, not rate_limit
Some providers (Z.ai/GLM, Anthropic) return HTTP 429 with an 'overloaded'
message body when their model fleet is at capacity. This is a transient
server-side overload, not a per-account rate limit.
Two changes in errors.ts:
1. classifyFailoverClassificationFromMessage: check isOverloadedErrorMessage
BEFORE isRateLimitErrorMessage. The rateLimit pattern /429/ was matching
'429 The service may be temporarily overloaded' first, returning
'rate_limit' before isOverloadedErrorMessage was ever evaluated.
2. classifyFailoverClassificationFromHttpStatus: add overloaded check for
HTTP 429 (matching existing 503/499 handlers that already check
messageReason === 'overloaded').
Previously, 429 overloaded responses triggered immediate model fallback
instead of retry-with-backoff, causing unnecessary failovers and ~30-60s
stalls on every turn when ZAI was overloaded.
Added 6 test cases covering: 'temporarily overloaded', bare 'overloaded',
'model is at capacity', and regression tests for 'rate limit exceeded',
'too many requests', and billing messages.1 parent ec737ee commit 416905b
2 files changed
Lines changed: 60 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
808 | 808 | | |
809 | 809 | | |
810 | 810 | | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
811 | 819 | | |
812 | 820 | | |
813 | 821 | | |
| |||
1031 | 1039 | | |
1032 | 1040 | | |
1033 | 1041 | | |
1034 | | - | |
1035 | | - | |
1036 | | - | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
1037 | 1047 | | |
1038 | 1048 | | |
1039 | 1049 | | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
1040 | 1053 | | |
1041 | 1054 | | |
1042 | 1055 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
182 | 226 | | |
183 | 227 | | |
184 | 228 | | |
| |||
0 commit comments