You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the Bug:
With Gemini(use_interactions_api=True), every failed interaction comes back as error_code="UNKNOWN_ERROR" and error_message="Unknown error". The real error, such as RESOURCE_EXHAUSTED: Quota exceeded…, never reaches the caller, so retries, on_model_error_callback and logs can't tell a quota error from a bad request.
convert_interaction_to_llm_response reads interaction.error, but no google-genai Interaction declares an error field. The API puts failures in errors: list[Error(code, message)]. On a completed SSE event, the partial InteractionSseEventInteraction keeps the same undeclared errors as raw dicts. So getattr(interaction, 'error', None) is always None, and the defaults win. This affects non-streaming calls, deferred-tier polling and streaming.
build_interactions_response_log reads the same missing field, so the debug log of a failed interaction always shows Error: (none).
The existing test_failed_response doesn't catch this, because it sets interaction.error = MagicMock(...) by hand.
Steps to Reproduce:
Use Gemini(model="gemini-3-flash-preview", use_interactions_api=True).
Have the API return a failed interaction, e.g. {"id": "int-9", "status": "failed", "errors": [{"code": "RESOURCE_EXHAUSTED", "message": "Quota exceeded for model gemini-3-flash-preview"}]}.
Expected Behavior: LlmResponse.error_code == "RESOURCE_EXHAUSTED" and error_message == "Quota exceeded for model gemini-3-flash-preview".
Observed Behavior:
With a real google-genai client (2.34.0) and an httpx.MockTransport returning the payload above:
1a5a36d, which landed on main on 11-02, fixes this for non-streaming and polled calls. convert_interaction_to_llm_response and build_interactions_response_log now read interaction.errors. On main, the repro above now returns RESOURCE_EXHAUSTED / Quota exceeded, and the response log shows the error.
The streaming line in the report came from a mocked interaction.completed event that carried errors. The SDK's InteractionSseEventInteraction doesn't declare that field, and a streamed failure arrives as an error event, which ADK already reads. So nothing from this issue is left. I'm closing #7883 as superseded, and closing this issue as fixed by 1a5a36d.
Activity
adityasingh2400 commentedon Nov 3, 2026
1a5a36d, which landed on main on 11-02, fixes this for non-streaming and polled calls.
convert_interaction_to_llm_responseandbuild_interactions_response_lognow readinteraction.errors. On main, the repro above now returnsRESOURCE_EXHAUSTED/Quota exceeded, and the response log shows the error.The streaming line in the report came from a mocked
interaction.completedevent that carriederrors. The SDK'sInteractionSseEventInteractiondoesn't declare that field, and a streamed failure arrives as anerrorevent, which ADK already reads. So nothing from this issue is left. I'm closing #7883 as superseded, and closing this issue as fixed by 1a5a36d.