Skip to content

Commit de841a4

Browse files
GWealecopybara-github
authored andcommitted
chore: Improve error message for missing invocation_id and new_message in run_async
Help with issue in #3801 Co-authored-by: George Weale <[email protected]> PiperOrigin-RevId: 840833736
1 parent b7ce5e1 commit de841a4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/google/adk/runners.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,11 @@ async def _run_with_trace(
412412
message = self._format_session_not_found_message(session_id)
413413
raise ValueError(message)
414414
if not invocation_id and not new_message:
415-
raise ValueError('Both invocation_id and new_message are None.')
415+
raise ValueError(
416+
'Running an agent requires either a new_message or an '
417+
'invocation_id to resume a previous invocation. '
418+
f'Session: {session_id}, User: {user_id}'
419+
)
416420

417421
if invocation_id:
418422
if (

0 commit comments

Comments
 (0)