Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add retry on rate limit errors #1095

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

unexge
Copy link
Contributor

@unexge unexge commented Feb 5, 2025

While working on #1008 I was using an AWS account with a lower request limit, and I was getting throttling exceptions frequently similar to what's reported on #887. This PR adds a new environment variable GOOSE_AGENT_RETRY_MULTIPLIER_MS to enable retries on ProviderError::RateLimitExceeded errors from Providers in TruncateAgent. It uses a very simple retry with exponential backoff.

For example, I tried to add a MetricAgent to goose, and after some iterations I got a rate limit error:
Screenshot 2025-02-05 at 19 57 53

then I enabled retry by changing my config:
Screenshot 2025-02-05 at 20 07 38

and this time after rate limits, goose agent retries the request and got success on the second retry:
Screenshot 2025-02-05 at 20 00 48

Of course if the limit is too low it will probably do lots of unsuccessful retries, but I feel like this could be helpful in some cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant