cabana8471
f018b4c1d8
fix: address PR #109 review feedback from leonvanzyl
...
- BLOCKER: Remove clear_stuck_features import and psutil block (doesn't exist in upstream)
- Fix overly broad rate limit patterns to avoid false positives
- Remove "please wait", "try again later", "limit reached", "429" (bare)
- Convert to regex-based detection with word boundaries
- Add patterns for "http 429", "status 429", "error 429"
- Add bounds checking (1-3600s) for parsed retry delays
- Use is_rate_limit_error() consistently instead of inline pattern matching
- Extract backoff functions to rate_limit_utils.py for testability
- calculate_rate_limit_backoff() for exponential backoff
- calculate_error_backoff() for linear backoff
- clamp_retry_delay() for safe range enforcement
- Rename test_agent.py to test_rate_limit_utils.py (matches module)
- Add comprehensive false-positive tests:
- Version numbers (v14.29.0)
- Issue/PR numbers (#429 )
- Line numbers (file.py:429)
- Port numbers (4293)
- Legitimate wait/retry messages
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-01-30 21:20:52 +01:00