#22792: fix(failover): add word boundary to 429 pattern in ERROR_PATTERNS
agents
size: XS
Cluster:
Error Handling Improvements
## Summary
- Adds `\b` word boundary to the `429` alternative in `ERROR_PATTERNS.rateLimit` regex, preventing false-positive rate-limit classification when `429` appears as a substring (e.g. in temp directory names like `openclaw-agent-429gnJ`)
The top-level `RATE_LIMIT_HINT_RE` (line 61) already uses `429\b`, and the `billing`/`auth` patterns use `\b` around their HTTP status codes (`\b402\b`, `\b401\b`, `\b403\b`). This aligns `ERROR_PATTERNS.rateLimit` with the same convention.
Fixes #11183
## Local Validation
- [x] Verified the regex change is consistent with other status code patterns in the same file
- [x] No other occurrences of bare `429` in error classification patterns
## Scope
XS — 1-line regex change in one file
## AI Assistance
Used Claude Code for issue investigation and fix implementation.
## Author
@miloudbelarebia
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Adds word boundary `\b` to the `429` pattern in `ERROR_PATTERNS.rateLimit` regex, preventing false-positive rate-limit classification when `429` appears as a substring in unrelated text (e.g., temp directory names like `openclaw-agent-429gnJ`).
The fix aligns with existing patterns in the same file:
- `RATE_LIMIT_HINT_RE` (line 61) already uses `429\b`
- Auth patterns use `\b401\b` and `\b403\b` (lines 622-623)
- Billing patterns use `\b402\b` (line 603)
This is a targeted, low-risk fix that improves error classification accuracy.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk
- Single-character regex change that fixes a legitimate bug (false-positive matching). The fix is consistent with existing patterns in the same file, well-documented in the PR description, and has minimal blast radius - it only affects error classification logic for rate-limit detection. The change makes the pattern more precise without removing any legitimate matches.
- No files require special attention
<sub>Last reviewed commit: d8427ea</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#11170: fix: classify subscription quota limit errors as rate_limit for fai...
by Yida-Dev · 2026-02-07
76.7%
#19926: fix: Extract status code from error messages for empty 429 responses
by gaurav10gg · 2026-02-18
75.5%
#16962: fix: make auth error detection contextual to prevent false positives
by StressTestor · 2026-02-15
75.1%
#17231: fix(failover): recognize model_cooldown as rate-limit for fallback
by thebtf · 2026-02-15
74.4%
#20262: fix: detect Venice 402 insufficient USD/Diem balance as billing fai...
by ZPTDclaw · 2026-02-18
73.1%
#12273: fix: prevent billing error false positive on bare '402' in chat con...
by Yida-Dev · 2026-02-09
72.5%
#15109: fix: distinguish transient API errors from billing errors
by jwchmodx · 2026-02-13
70.2%
#8661: fix: display rate limit errors correctly instead of as context over...
by dbottme · 2026-02-04
70.0%
#21033: fix(failover): classify connection errors as timeout for model fail...
by zerone0x · 2026-02-19
69.8%
#20982: Improve 429 messaging for Retry-After parse failures and failover
by Tsopic · 2026-02-19
69.6%