Skip to content

Fix: Sub-agent with sequential LRO tools fails to resume (Issue #5349)#5365

Draft
9chait9 wants to merge 2 commits intogoogle:mainfrom
9chait9:fix/issue-5349
Draft

Fix: Sub-agent with sequential LRO tools fails to resume (Issue #5349)#5365
9chait9 wants to merge 2 commits intogoogle:mainfrom
9chait9:fix/issue-5349

Conversation

@9chait9
Copy link
Copy Markdown

@9chait9 9chait9 commented Apr 17, 2026

Fixes #5349

Change Summary

The issue was caused by an incorrect assumption in the orchestrator's flow control for sub-agents. When a sub-agent was resumed, the orchestrator unconditionally marked the sub-agent as finished (end_of_agent=True) after the run_async generator finished.

In the case of a sub-agent using LROs, the generator finishes when the sub-agent pauses. The orchestrator mistook this pause for agent completion. Consequently, when the user provided the response for the next LRO, the system replayed the stale end_of_agent=True flag, causing the runner to terminate execution prematurely.

The fix introduces a check to track if the sub-agent paused for an LRO. end_of_agent=True is now only set if the sub-agent did not pause.

9chait9 added 2 commits April 17, 2026 02:41
The sub-agent resumption logic was incorrectly marking the agent as finished
even if the sub-agent had merely paused (e.g., to wait for a long-running
operation). This change tracks whether the sub-agent paused, and only
marks the agent as finished if no pause occurred.

Fixes google#5349
…esume.

Modified `_run_async_impl` in `llm_agent.py` to prevent premature `end_of_agent` marking when a sub-agent pauses for an LRO. Added `sub_agent_paused` tracking to ensure `end_of_agent=True` is only set if the sub-agent actually finished.
@adk-bot
Copy link
Copy Markdown
Collaborator

adk-bot commented Apr 17, 2026

Response from ADK Triaging Agent

Hello @9chait9, thank you for creating this PR!

To help reviewers to review your PR more efficiently, could you please include a testing plan section in your PR to describe how you tested it? In addition, since this is a bug fix, could you please provide logs or a screenshot after the fix is applied?

Thanks!

@adk-bot adk-bot added the core [Component] This issue is related to the core interface and implementation label Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core [Component] This issue is related to the core interface and implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sub-agent with sequential LRO tools fails to resume

2 participants