Repository navigation
fix(runners): preserve multi-branch visibility for function responses (#8515) - #8521
Open
Abdulrehman1978 wants to merge 1 commit into
Open
Abdulrehman1978 wants to merge 1 commit into
Abdulrehman1978 wants to merge 1 commit into
Conversation
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.
Summary
When a single user message carries
function_responses answering long-running tool calls from multiple branches of a resumableParallelAgent,_stamp_event_branch_context()previously calledfind_matching_function_call()(which only inspects the firstfunction_response) and stamped the entire user event with that first call'sbranch(e.g.root.a). As a result, sibling branches (root.b) never received the user event inInvocationContext._get_events(current_branch=True)and stayed paused.Fixes #8515
Changes
_stamp_event_branch_context()insrc/google/adk/runners.pyto match allfunction_responses in the event against prior function calls in the invocation.branch, stampevent.branchas before.event.branchunset (None) so each branch receives the event whileInvocationContext._get_events(current_branch=True)continues to scope responses by_branch_function_call_ids().event.isolation_scopewhen all matched calls agree on a single non-Nonescope.test_resumable_parallel_agent_single_message_resumes_all_branchesintests/unittests/runners/test_resume_invocation.py.Testing
pytest tests/unittests/runners/test_resume_invocation.py tests/unittests/runners/test_pause_invocation.py tests/unittests/agents/test_parallel_agent.py -q(33 passed, 1 skipped, 3 xfailed)