Retry functionality
Describe the bug
When using Gemini, the agent sometimes makes too many calls too quickly, which consumes the quota.
logs:
Error 429, Message: You exceeded your current quota, please check your plan and billing details.
For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits.
None
Status: RESOURCE_EXHAUSTED,
Details: [map[@type:type.googleapis.com/google.rpc.QuotaFailure violations:[map[quotaDimensions:map[location:global model:gemini-2.5-flash] quotaId:GenerateContentInputTokensPerModelPerMinute-FreeTier quotaMetric:generativelanguage.googleapis.com/generate_content_free_tier_input_token_count quotaValue:250000]]] map[@type:type.googleapis.com/google.rpc.Help links:[map[description:
Learn
more about Gemini API quotas url:https://ai.google.dev/gemini-api/docs/rate-limits]]] map[@type:type.googleapis.com/google.rpc.RetryInfo retryDelay:12s]]
In this case, I would wait 12 seconds so the agent can read this. If it detects 'Error 429, Message: You exceeded your current quota' and retryDelay: XXs, it can use the wait/sleep tool. This approach can be extended to other providers that have similar restrictions.
Setup
Please complete the following information along with version numbers, if applicable.
- OS: Windows 11/ WSL 2/ Ubuntu
- Shell: zsh
- Terminal Emulator: Windows Terminal
- Terminal Multiplexer: tmux
To Reproduce
Steps to reproduce the behavior:
- Ask Gemini to do a big task
- Sometimes it will hit the quota
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
Add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
@omar2205 thanks for sharing this, I am working on retry functionality so this will be included.
As an alternative, it would be great if you could configure an RPM cap so that Crush wouldn't even hit the error but would know when to wait.
Yeah, I think having an RPM cap is better (with retry as a backup), since just using retry might lose track of what it already did and what actually failed.
any progress on it ?
any progress on it ?
any progress on it ?
Related to: #420 & #1414