fix(agents): only stop ParallelAgent on direct sub-agent escalation - #1491
Open
mithun-sudo wants to merge 1 commit into
Open
fix(agents): only stop ParallelAgent on direct sub-agent escalation#1491mithun-sudo wants to merge 1 commit into
mithun-sudo wants to merge 1 commit into
Conversation
Match adk-python: nested escalate events must not cancel sibling branches. Adds regression test for LoopAgent nested under ParallelAgent.
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. |
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