Skip to content

Fix sub-agent premature termination in LRO tool flow (Issue #5349)#5384

Draft
9chait9 wants to merge 1 commit intogoogle:mainfrom
9chait9:fix/issue-5349-v2
Draft

Fix sub-agent premature termination in LRO tool flow (Issue #5349)#5384
9chait9 wants to merge 1 commit intogoogle:mainfrom
9chait9:fix/issue-5349-v2

Conversation

@9chait9
Copy link
Copy Markdown

@9chait9 9chait9 commented Apr 18, 2026

Fixes #5349

The issue occurred because the orchestrator unconditionally marked a sub-agent as end_of_agent=True after resumption, even if it had paused for another long-running operation (LRO).

This change tracks the pause state of the sub-agent during resumption and only marks the agent as finished if it did not pause.

Summary of changes:

  • Modified _run_async_impl in src/google/adk/agents/llm_agent.py to track sub_agent_paused state.
  • Only call ctx.set_agent_state(self.name, end_of_agent=True) if sub_agent_paused is false.

…ool.

Fixes google#5349
- Track sub-agent pause state during resumption.
- Only mark as finished if the sub-agent did not pause.
@adk-bot adk-bot added the core [Component] This issue is related to the core interface and implementation label Apr 18, 2026
@adk-bot
Copy link
Copy Markdown
Collaborator

adk-bot commented Apr 18, 2026

Response from ADK Triaging Agent

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

Could you please add a testing plan section to your PR description to describe how you tested the change?

In addition, could you please provide logs or screenshot after the fix is applied?

This information will help reviewers to review your PR more efficiently. Thanks!

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