Problem
The Agent encounters "429 Too Many Requests" errors from the Copilot API, causing the agent to fail and throw an error.
Error message:
Agent error: Copilot API error: 429 Too Many Requests
Expected Behavior
The Agent should gracefully handle 429 rate limit responses by:
- Implementing exponential backoff/retry logic
- Displaying a user-friendly message about rate limiting
- Continuing operation once rate limit resets
Current Behavior
- Agent fails immediately when hitting a 429 response
- No retry logic is implemented
- User sees a cryptic error message
Proposed Solution
Implement rate limit handling:
- Detect 429 status code from API responses
- Parse
Retry-After header if present
- Implement exponential backoff with jitter
- Show progress/waiting indicator to user
- Retry request after appropriate delay
- Add max retry limit to prevent infinite loops
Files to Investigate
- Agent API call implementations
- HTTP client configuration
- Error handling middleware
Acceptance Criteria