crush icon indicating copy to clipboard operation
crush copied to clipboard

Retry functionality

Open omar2205 opened this issue 5 months ago • 8 comments

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:

  1. Ask Gemini to do a big task
  2. 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 avatar Aug 04 '25 10:08 omar2205

@omar2205 thanks for sharing this, I am working on retry functionality so this will be included.

kujtimiihoxha avatar Aug 04 '25 10:08 kujtimiihoxha

Image

Anny26022 avatar Aug 04 '25 11:08 Anny26022

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.

venantius avatar Aug 05 '25 10:08 venantius

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.

omar2205 avatar Aug 05 '25 13:08 omar2205

any progress on it ?

itbaby avatar Aug 06 '25 12:08 itbaby

any progress on it ?

zhilianbi520 avatar Sep 12 '25 03:09 zhilianbi520

any progress on it ?

dinarsadykow avatar Sep 19 '25 10:09 dinarsadykow

Related to: #420 & #1414

LarsArtmann avatar Nov 09 '25 14:11 LarsArtmann