- Narrow `\boverloaded\b` regex to require server/api/system context,
preventing false positives when Claude discusses method/operator
overloading in OOP code (C++, Java, C#, etc.)
- Restore 24-hour cap for absolute reset-time delays instead of 1-hour
clamp, avoiding unnecessary retry loops when rate limits reset hours
in the future
- Add test for Retry-After: 0 returning 0 (regression lock for the
`is not None` fix)
- Add false positive tests for "overloaded" in programming context
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1. agent.py: Reset opposite retry counter when entering rate_limit or error
status to prevent mixed events from inflating delays
2. rate_limit_utils.py: Fix parse_retry_after() regex to reject minute/hour
units - patterns now require explicit "seconds"/"s" unit or end of string
3. test_rate_limit_utils.py: Add tests for "retry after 5 minutes" and other
minute/hour variants to ensure they return None
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create rate_limit_utils.py with shared constants and functions
- Update agent.py to import from shared module
- Update test_agent.py to import from shared module (removes duplication)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>