🔴 Required Information
Describe the Bug:
Any agent with LoopAgent will cause Attribute Error with ADK 2.1.0 when run using
runner API and root_agent is LlmAgent.
Steps to Reproduce:
Please provide a numbered list of steps to reproduce the behavior:
- Install ADK==2.1.0
- Run agent where root_agent has on of the subagents - LoopAgent.
- See the error:
File "/home/alex/env3/lib/python3.13/site-packages/google/adk/flows/llm_flows/agent_transfer.py", line 196, in _get_transfer_targets
and peer_agent.mode not in ('single_turn', 'task')
^^^^^^^^^^^^^^^
File "/home/alex/env3/lib/python3.13/site-packages/pydantic/main.py", line 1042, in __getattr__
raise AttributeError(f'{type(self).__name__!r} object has no attribute {item!r}')
AttributeError: 'LoopAgent' object has no attribute 'mode'
Expected Behavior:
LoopAgent should work like in version 1.34.1.
Observed Behavior:
What actually happened? Include error messages or crash stack traces here.
Environment Details:
- ADK Library Version (pip show google-adk): 2.1.0
- Desktop OS:** Ubuntu/Debian
- Python Version (python -V): 3.13
Model Information:
- Are you using LiteLLM: No
- Which model is being used: gemini-3.5-flash
Fix
Do hasattr check in the line 192 similar to the code above that.
if not agent.disallow_transfer_to_peers:
result.extend([
peer_agent
for peer_agent in agent.parent_agent.sub_agents
if peer_agent.name != agent.name
and (not hasattr(peer_agent, 'mode') # <-- Add guard here
or peer_agent.mode not in ('single_turn', 'task'))
])
How often has this issue occurred?:
🔴 Required Information
Describe the Bug:
Any agent with LoopAgent will cause Attribute Error with ADK 2.1.0 when run using
runner API and root_agent is LlmAgent.
Steps to Reproduce:
Please provide a numbered list of steps to reproduce the behavior:
Expected Behavior:
LoopAgent should work like in version 1.34.1.
Observed Behavior:
What actually happened? Include error messages or crash stack traces here.
Environment Details:
Model Information:
Fix
Do hasattr check in the line 192 similar to the code above that.
How often has this issue occurred?: