Repository navigation
fix(runner): raise ValueError in run_async when new_message and invoc… - #7936
Open
mohitdixit02 wants to merge 5 commits into
Open
mohitdixit02 wants to merge 5 commits into
mohitdixit02 wants to merge 5 commits into
Conversation
…ation_id are None (google#7934)
…engthen history tests (google#7934) # Conflicts: # src/google/adk/runners.py
mohitdixit02
force-pushed
the
fix/runner-run-async-validate-message
branch
from
November 6, 2026 16:50
a3e2ba6 to
1ea3061
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
Runner.run_asyncruns anLlmAgentwith neithernew_messagenorinvocation_idinstead of raisingValueError#7934Problem:
When
Runner.run_asyncis invoked on an empty session without anew_messageorinvocation_id, it is expected to raise aValueError. However:LlmAgentor aBaseNode,run_asyncbranched into_run_node_async()and returned before reaching the validation check in_run_with_trace, dispatching empty contents ([[]]) to the underlying model.not new_message and not invocation_idwould break valid workflows and conversational sessions where events already exist in history and the caller only wishes to continue/resume execution without appending a new user turn.run_asyncfetched the session for validation, and subsequent inner methods (_run_node_async,_run_with_trace) performed redundant fetches.Solution:
Runner.run_asyncimmediately following session retrieval:Testing Plan
Unit Tests:
Summary of targeted pytest runs:
Manual End-to-End (E2E) Tests:
Verified against the reproduction script in #7934 with an LlmAgent and a recording model:
Checklist