From de841a4a0982d98ade4478f10481c817a923faa2 Mon Sep 17 00:00:00 2001 From: George Weale Date: Fri, 5 Dec 2025 12:33:47 -0800 Subject: [PATCH] chore: Improve error message for missing invocation_id and new_message in run_async Help with issue in #3801 Co-authored-by: George Weale PiperOrigin-RevId: 840833736 --- src/google/adk/runners.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/google/adk/runners.py b/src/google/adk/runners.py index 4cf5a295..33187ff0 100644 --- a/src/google/adk/runners.py +++ b/src/google/adk/runners.py @@ -412,7 +412,11 @@ class Runner: message = self._format_session_not_found_message(session_id) raise ValueError(message) if not invocation_id and not new_message: - raise ValueError('Both invocation_id and new_message are None.') + raise ValueError( + 'Running an agent requires either a new_message or an ' + 'invocation_id to resume a previous invocation. ' + f'Session: {session_id}, User: {user_id}' + ) if invocation_id: if (