chore: Improve error message for missing invocation_id and new_message in run_async

Help with issue in #3801

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 840833736
This commit is contained in:
George Weale
2025-12-05 12:33:47 -08:00
committed by Copybara-Service
parent b7ce5e17b6
commit de841a4a09
+5 -1
View File
@@ -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 (