fix: address rate limit detection false positives and reset-time cap

- 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>
This commit is contained in:
Auto
2026-02-01 10:39:07 +02:00
parent e7aeea6b77
commit c4d0c6c9b2
3 changed files with 18 additions and 2 deletions

View File

@@ -325,7 +325,7 @@ async def run_autonomous_agent(
target += timedelta(days=1)
delta = target - now
delay_seconds = clamp_retry_delay(int(delta.total_seconds()))
delay_seconds = min(max(int(delta.total_seconds()), 1), 24 * 60 * 60)
target_time_str = target.strftime("%B %d, %Y at %I:%M %p %Z")
except Exception as e: