← Back to PRs

#22792: fix(failover): add word boundary to 429 pattern in ERROR_PATTERNS

by miloudbelarebia open 2026-02-21 17:32 View on GitHub →
agents size: XS
## 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