Repository navigation
fix: classify overloaded 429 responses as overloaded, not rate_limit (fixes #98101) - #98109
liuhao1024 wants to merge 1 commit into
Conversation
When a provider returns HTTP 429 with an overloaded body (e.g. z.ai code 1305, 'temporarily overloaded'), the error was misclassified as rate_limit because: 1. In classifyFailoverClassificationFromMessage: isRateLimitErrorMessage matches the bare '429' pattern before isOverloadedErrorMessage runs. 2. In classifyFailoverClassificationFromHttpStatus: the 429 branch only checks billing then defaults to rate_limit, unlike 503/499 which check overloaded first. Fix: reorder isOverloadedErrorMessage before isRateLimitErrorMessage in the message classifier, and add an overloaded check in the 429 branch of the status classifier (matching the existing 503/499 pattern). Fixes openclaw#98101
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close: this PR is a narrower duplicate of the overloaded-429 fix and is superseded by an open proof-positive candidate that covers the missing user-facing copy path as well as the classifier paths. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Use #98165 as the canonical landing path because it covers the status, message, and user-facing copy paths, then close this duplicate branch and keep the linked issue open until the chosen fix merges. So I’m closing this here and keeping the remaining discussion on #98165 and #97009. Review detailsBest possible solution: Use #98165 as the canonical landing path because it covers the status, message, and user-facing copy paths, then close this duplicate branch and keep the linked issue open until the chosen fix merges. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main and v2026.6.11 match bare Is this the best way to solve the issue? No. This is a plausible partial fix, but the best fix must also update Security review: Security review cleared: The diff only changes TypeScript classifier logic and tests; it does not touch dependencies, workflows, secrets, package resolution, or code-execution surfaces. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 704c58468667. |
|
Superseded by #98165, landed as The official Z.AI error contract defines HTTP 429 as limiting and business code 1305 as a triggered rate limit; code 1312 is the separate model-high-traffic condition. Reclassifying 1305 to #98165 fixes the valid user-visible defect instead: it preserves overload wording when no more actionable retry detail exists, retains explicit retry/reset guidance, and leaves internal 429 backoff as |
What Problem This Solves
When a provider returns HTTP 429 with an "overloaded" body (e.g. z.ai code 1305: "The service may be temporarily overloaded, please try again later"), OpenClaw misclassifies it as a rate limit instead of an overload. This causes:
rate_limitinstead ofoverloaded, which triggers incorrect cooldown/rate-limit handlingThe same class of bug was already fixed for billing 429 responses (#43447, #32828), but the overloaded case at 429 was missed.
Why This Change Was Made
Two-level fix addressing both classification paths:
Message classifier (
classifyFailoverClassificationFromMessage):isRateLimitErrorMessagematched the bare429pattern (/rate[_ ]limit|too many requests|429/) beforeisOverloadedErrorMessagecould run. Reordered overloaded check before rate-limit check.HTTP status classifier (
classifyFailoverClassificationFromHttpStatus): Thestatus === 429branch only checked billing then defaulted torate_limit. Added an overloaded check matching the existing 503/499 pattern.User Impact
overloadedinstead ofrate_limitEvidence
Real behavior proof
overloadedinstead ofrate_limitupstream/main(738b2be)pnpm build)node scripts/verification script run src/agents/embedded-agent-helpers/failover-matches.test.tsclassifyFailoverReasonFromHttpStatus(429, overloadedBody)returns"overloaded"Observed result after fix: All 32 pass including 3 new tests for 429 overloaded classification. The function
classifyFailoverReasonFromHttpStatus(429, overloadedMessage)correctly returns"overloaded", whileclassifyFailoverReasonFromHttpStatus(429, rateLimitMessage)still returns"rate_limit"andclassifyFailoverReasonFromHttpStatus(429, billingMessage)returns"billing".What was not tested: Live provider interaction with z.ai (requires real API key). The fix is validated at the classification function level which is the same code path used by the production CLI.
AI-assisted (Hermes Agent)