Repository navigation
fix(agents): preserve overload wording for rate-limited responses - #98165
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 30, 2026, 9:55 AM ET / 13:55 UTC. Summary PR surface: Source +16, Tests +59. Total +75 across 3 files. Reproducibility: yes. Source inspection shows current main matches bare 429 as rate_limit before overloaded and the explicit 429 status branch defaults to rate_limit after billing checks. Review metrics: 2 noteworthy metrics.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land one canonical shared classifier/copy fix that preserves model-capacity copy precedence, covers overloaded 429 status and message paths, and keeps the linked issue open until the chosen PR merges. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main matches bare 429 as rate_limit before overloaded and the explicit 429 status branch defaults to rate_limit after billing checks. Is this the best way to solve the issue? Yes. The shared classifier/status/copy fix is the right layer for provider-agnostic overloaded 429s; a provider-only workaround or message-only reorder would leave either the status path or user-facing copy path broken. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6cb82eaab865. Label changesLabel justifications:
Evidence reviewedPR surface: Source +16, Tests +59. Total +75 across 3 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
fff2313 to
93c609c
Compare
…not rate_limit Reorder overloaded check before rate_limit across all three classification paths: - classifyFailoverClassificationFromHttpStatus (HTTP status path) - classifyFailoverClassificationFromMessage (message text path) - formatRateLimitOrOverloadedErrorCopy (user-facing copy path) Previously, isRateLimitErrorMessage matched the bare '429' token in overloaded-worded 429 bodies (e.g. z.ai code 1305), misclassifying them as rate_limit and showing the wrong user-facing error message. 503/499 already check overloaded before defaulting; 429 now follows the same pattern. Related to openclaw#98101
…er-facing copy
MODEL_CAPACITY_ERROR_RE is the most specific overloaded variant
('selected model is at capacity') and must be checked before the
broader isOverloadedErrorMessage matcher (which also covers model at
capacity), otherwise it's shadowed with a less specific message.
Related to openclaw#98101
93c609c to
0b1b722
Compare
|
Maintainer fixup complete; this is land-ready at exact head
Thanks @SunnyShu0925 for surfacing the overlapping 429/overload path and contributing the initial regression coverage. |
|
Land-ready verification completed on exact head
No known proof gaps remain. Separating user-facing copy from failover classification is the best fix: overload wording becomes accurate, explicit retry/reset guidance remains visible, and documented profile cooldown behavior is preserved. |
|
Merged via squash.
|
…enclaw#98165) * [AI] fix(agents): classify HTTP 429 overloaded bodies as overloaded, not rate_limit Reorder overloaded check before rate_limit across all three classification paths: - classifyFailoverClassificationFromHttpStatus (HTTP status path) - classifyFailoverClassificationFromMessage (message text path) - formatRateLimitOrOverloadedErrorCopy (user-facing copy path) Previously, isRateLimitErrorMessage matched the bare '429' token in overloaded-worded 429 bodies (e.g. z.ai code 1305), misclassifying them as rate_limit and showing the wrong user-facing error message. 503/499 already check overloaded before defaulting; 429 now follows the same pattern. Related to openclaw#98101 * [AI] fix(agents): put MODEL_CAPACITY_ERROR_RE before overloaded in user-facing copy MODEL_CAPACITY_ERROR_RE is the most specific overloaded variant ('selected model is at capacity') and must be checked before the broader isOverloadedErrorMessage matcher (which also covers model at capacity), otherwise it's shadowed with a less specific message. Related to openclaw#98101 * fix(agents): preserve overload copy for rate-limited responses * fix(agents): retain provider retry guidance --------- Co-authored-by: Peter Steinberger <[email protected]>
Related to #98101
What Problem This Solves
Z.AI can return HTTP 429 / business code 1305 with the message “temporarily overloaded.” OpenClaw correctly routes that response through rate-limit backoff, but the user-facing formatter previously stopped at the bare 429 token and displayed the generic “API rate limit reached” copy instead of preserving the provider's overload wording.
Why This Change Was Made
User-facing wording and retry classification are separate decisions. The formatter now:
The internal 429 classification remains
rate_limit. Z.AI's official error contract defines HTTP 429 as concurrency/frequency/account limiting and business code 1305 as a triggered rate limit; changing it tooverloadedwould incorrectly alter profile cooldown and fallback behavior.User Impact
Users now see “The AI service is temporarily overloaded. Please try again in a moment.” for overload-worded Z.AI 1305 responses, while explicit retry windows still surface and documented rate-limit backoff remains intact.
Thanks @SunnyShu0925 for surfacing the overlapping 429/overload formatter path and contributing the original regression coverage.
Evidence
0b1b722a1adfb61f284d1e453518b72c089bf777(exact-head CI).cbx_059970447f01, runrun_9d9bfcd2a344: public networking, no Tailscale, no instance role, no credential hydration, and reviewed-SHA pinning.git diff --checkpassed.