Skip to content

New Feature: Enhanced Error Handling for Gemini resourceExhausted in ADK #3803

Closed

Description

@MarzoukiAziz

💡 New Feature: Enhanced Error Handling for Gemini resourceExhausted in ADK

Description .

I'm frustrated when I encounter a resourceExhausted error while using the Gemini API through the Google ADK, and the application provides no clear, programmatic way to handle this situation gracefully or inform the user effectively. This typically happens when the user's quota limit for the Gemini API has been reached. Currently, this can lead to a poor user experience, as the api fail immediately.

Solution

To implement a retry-based solution for the resourceExhausted error without immediately cutting the stream, you should first specifically detect the quota-related error from the ADK's response, then initiate a series of escalating retries using exponential backoff to temporarily pause the interaction instead of terminating it immediately, informing the user that the service is busy and trying again shortly; if these retries fail, the system should gracefully degrade by either switching to a less resource-intensive Gemini model or disabling resource-heavy features within the current user session, only terminating the stream as a last resort when all other recovery attempts are exhausted.

Activity

  1. added
    core[Component] This issue is related to the core interface and implementation
    on Dec 3, 2025
  2. added theissue type on Dec 3, 2025
  3. VariableVic commented on Dec 3, 2025

    @VariableVic

    Completely agree. ADK really needs proper handling for those persistent Gemini 429 errors. It’s the one issue still holding me back from pushing my agent into production.

    Edit: passing HttpRetryOptions doesn't seem to do anything for this specific error.

  4. adirani-alg commented on Dec 3, 2025

    @adirani-alg

    encoutering the same issue

  5. Jihed-Benmohamed commented on Dec 3, 2025

    @Jihed-Benmohamed

    Second this highly ! would be really good to know the source of such a problem .

  6. veevortexiq commented on Dec 3, 2025

    @veevortexiq

    We have about 70+ agents, ready to go to production, but stakeholders arw scared because of this

  7. locked and limited conversation to collaborators on Dec 4, 2025
  8. converted this issue into a discussion #3812 on Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    core[Component] This issue is related to the core interface and implementation

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions