Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/google/adk/agents/llm_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,10 @@ def _get_subagent_to_resume(

# Last event is from another agent, or from user for another agent's tool
# call. We need to find the last agent we transferred to.
for event in reversed(events):
# Events without content, potentially from callbacks with state_deltas,
# should be skipped as they don't represent a transfer to an agent
# that should continue the conversation with the user.
for event in (e for e in reversed(events) if e.content):
if agent := self.__get_transfer_to_agent_or_none(event, self.name):
return agent

Expand Down