fix: scope single-turn node inputs to workflow branch#6008
Open
he-yufeng wants to merge 1 commit into
Open
Conversation
Collaborator
|
Response from ADK Triaging Agent Hello @he-yufeng, thank you for creating this PR! While reviewing your PR, we noticed it is mostly following the contribution guidelines. However, to help speed up the review process, could you please provide:
You can find more details in our contribution guidelines. Thank you! |
Collaborator
🔍 ADK Pull Request Analysis: PR #6008Title: fix: scope single-turn node inputs to workflow branch Executive Summary
Detailed Findings & Analysis1. Objectives & Impact ("What does it do?")
2. Justification & Value ("Is it a valid and useful change?")
3. Principle & Style Alignment Checklist ("Does it follow rules?")
Summary of Work
|
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
Fixes #5989.
prepare_llm_agent_input()appends the single-turn node input directly tosession.events, so it bypassesNodeRunner._enrich_event(). In a dynamicworkflow sub-branch, that left the private node input as a branchless user event.
Branchless user events are visible to sibling branches, which can make another
worker pick the wrong "current turn" boundary and slice out its own function
call.
This stamps the single-turn input event with the current invocation branch when
one exists, while preserving the existing isolation-scope stamping.
To verify
PYTHONPATH=src python -m pytest tests\unittests\workflow\test_llm_agent_as_node.py -q -k "single_turn_input_event_inherits_branch_and_scope"PYTHONPATH=src python -m pytest tests\unittests\workflow\test_llm_agent_as_node.py -qpython -m py_compile src\google\adk\workflow\_llm_agent_wrapper.py tests\unittests\workflow\test_llm_agent_as_node.pypython -m pyink --check src\google\adk\workflow\_llm_agent_wrapper.py tests\unittests\workflow\test_llm_agent_as_node.pypython -m isort --check-only src\google\adk\workflow\_llm_agent_wrapper.py tests\unittests\workflow\test_llm_agent_as_node.pygit diff --check