How to transfer_to_agent when escalate in a LoopAgent

1 day ago 1
ARTICLE AD BOX

# Does LoopAgent return control to parent after escalate in Google ADK?

I'm using Google ADK with this structure:

root_agent (LlmAgent)

└── loop (LoopAgent)

├── generator
├── critic
└── status_checker (BaseAgent)

My `status_checker` escalates when validation passes:

class StatusChecker(BaseAgent): async def _run_async_impl(self, ctx): should_stop = ctx.session.state.get("quality_status") == "pass" yield Event(author=self.name, actions=EventActions(escalate=should_stop))

**Problem**: After loop escalates, the last visible agent is `critic`, not `root_agent`. I want `root_agent` to:
1. Get control back after loop completes
2. Read `session.state['current_code']` and other results
3. Summarize and present final response to user

**Questions**:
1. Does LoopAgent **automatically** return control to parent (root_agent) after escalate?
2. How do I ensure root_agent processes the results? Via instruction/prompt or programmatically?
3. Should I use `EventActions.transfer_to_agent` in my custom agent, or does ADK handle parent-child transitions automatically?

I know tools can use `tool_context.actions.transfer_to_agent`, but I'm using a BaseAgent, not a tool.

Read Entire Article