fix(agents): only stop ParallelAgent on direct sub-agent escalation - #1491
Merged
copybara-service[bot] merged 1 commit intoSep 21, 2026
Merged
copybara-service[bot] merged 1 commit into
copybara-service[bot] merged 1 commit into
Conversation
hemasekhar-p
force-pushed
the
fix/parallel-agent-nested-escalation
branch
from
September 10, 2026 05:58
30bda8e to
47810f7
Compare
Contributor
|
Hi @mithun-sudo, thank you for your contribution. we appreciate you taking the time to submit this PR. It is currently under review by our team, and we will keep you updated if any additional information is required. |
wikaaaaa
requested changes
Sep 17, 2026
wikaaaaa
left a comment
There was a problem hiding this comment.
Thank you for the contribution! LGTM, two minor comments.
mithun-sudo
force-pushed
the
fix/parallel-agent-nested-escalation
branch
from
September 18, 2026 08:25
47810f7 to
daecb5b
Compare
wikaaaaa
approved these changes
Sep 21, 2026
|
@mithun-sudo thanks, approved. Can you please merge the latest changes from main into this branch? Its currently out-of-date. |
Match adk-python: nested escalate events must not cancel sibling branches. Adds regression test for LoopAgent nested under ParallelAgent.
mithun-sudo
force-pushed
the
fix/parallel-agent-nested-escalation
branch
from
September 21, 2026 10:18
daecb5b to
fc3e352
Compare
Contributor
Author
|
@wikaaaaa Thanks for reviewing the PR. Rebased onto latest main |
wikaaaaa
approved these changes
Sep 21, 2026
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.
Match adk-python: nested escalate events must not cancel sibling branches. Adds regression test for LoopAgent nested under ParallelAgent.
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
Problem:
ParallelAgentstops all parallel branches when any event hasescalate=true, including escalation from nested sub-agents (e.g. an agent inside aLoopAgentsub-branch). adk-python only stops when the escalating event's author is a direct sub-agent (_asks_this_agent_to_exit).Solution:
Filter
takeUntilwithasksThisAgentToExit(), which requires bothescalate=trueandevent.author()in the set of direct sub-agent names. Matches adk-python parity without changing behavior for direct sub-agent escalation (existing test still passes).Testing Plan
Unit Tests:
Summary:
./mvnw -pl core clean compile test -Dtest=ParallelAgentEscalationTest— 2 tests passed./mvnw -Prelease clean package— BUILD SUCCESSrunAsync_nestedLoopEscalation_keepsSiblingBranchesRunningfails on main (stream completes after 1 nested escalate) and passes with this changerunAsync_escalationEvent_shortCircuitsOtherAgentsstill passes (direct sub-agent escalate still short-circuits siblings)Manual End-to-End (E2E) Tests:
Not applicable — behavior covered by unit tests; no user-facing API or runtime config change.
Checklist
Additional context
Python reference:
src/google/adk/agents/parallel_agent.py—_asks_this_agent_to_exittests/unittests/agents/test_parallel_agent.py—test_run_async_keeps_siblings_when_a_nested_loop_ends_itself