adk-python icon indicating copy to clipboard operation
adk-python copied to clipboard

Empty response and UNKNOWN_ERROR

Open mrmza opened this issue 1 year ago • 6 comments

I randomly receive empty response from LLM followed by UNKNOWN_ERROR. The pattern I see is that this happens when agent 1. answer with text, 2. calls the tool and gets the result 3. Want to provide follow up message to the user.

Sometimes it works perfect, and sometimes I receive empty answer like this:

LLM Response:

Text: None

Function calls:


Raw response: {"model_version":"gemini-2.5-pro-preview-03-25","usage_metadata":{"prompt_token_count":9314,"prompt_tokens_details":[{"modality":"TEXT","token_count":9314}],"total_token_count":9314},"automatic_function_calling_history":[]}

Which later is followed by event with UNKNOWN_ERROR:

INFO | google.adk.sessions.database_session_service:append_event:439 - Append event: content=None grounding_metadata=None partial=None turn_complete=None error_code='UNKNOWN_ERROR' error_message='Unknown error.' interrupted=None custom_metadata=None invocation_id='e-7b409bad-ccfd-410c-ace1-424df582e296' author='host_agent' actions=EventActions(skip_summarization=None, state_delta={'artifact_list': ['user:app_profile.json', 'user:user_profile.json']}, artifact_delta={}, transfer_to_agent=None, escalate=None, requested_auth_configs={}) long_running_tool_ids=None branch=None id='ahgJFXKb' timestamp=1746279733.766547 to session 0ddb7351-375a-4007-a983-f4dd768b4870 - {}

Python 3.11.11 Name: google-adk Version: 0.3.0

mrmza avatar May 03 '25 14:05 mrmza

@mrmza can you provide the code snippet for debugging?

kavinkumar807 avatar May 03 '25 18:05 kavinkumar807

I also sometimes randomly get empty messages like the one in this issue. I can't find a consistent way of reproducing it though

avidelatm avatar May 12 '25 02:05 avidelatm

Version: 0.5.0 I'm experiencing the same problem. Any solutions or workarounds discovered so far? @mrmza

GaoZhuoXiu avatar May 22 '25 03:05 GaoZhuoXiu

I think this is due to model occasionally generate response with empty content. We previously had a fix for it in https://github.com/google/adk-python/commit/d387ab0c3807c2a8db725145a90d63367e0ff1cc.

Feel free to reopen and let us know if you still see it in 1.0.0+

Jacksunwei avatar May 28 '25 00:05 Jacksunwei

@Jacksunwei , I have been facing this issue recently, google-adk version 1.23.0

nipun-das avatar Feb 27 '26 09:02 nipun-das

same issues

adk/js

"@google/adk": "^1.1.0"

"@google/adk-devtools": "^1.1.0"

2winter-dev avatar May 23 '26 07:05 2winter-dev