Skip to content

Commit 34b953e

Browse files
DeanChensjcopybara-github
authored andcommitted
refactor: Clean up redundant self-transfer checks in LlmAgentWrapper
- Remove redundant self-transfer check in LlmAgentWrapper, relying on the unified check in transfer_utils. Co-authored-by: Shangjie Chen <deanchen@google.com> PiperOrigin-RevId: 943630479
1 parent ac99770 commit 34b953e

1 file changed

Lines changed: 0 additions & 4 deletions

File tree

src/google/adk/workflow/_llm_agent_wrapper.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -394,10 +394,6 @@ async def run_llm_agent_as_node(
394394
break # close this run_iter; outer loop re-enters
395395
if event.actions.transfer_to_agent:
396396
target_name = event.actions.transfer_to_agent
397-
if target_name == agent.name:
398-
raise ValueError(
399-
f"Agent '{target_name}' cannot transfer to itself."
400-
)
401397

402398
from ..agents.llm_agent import LlmAgent
403399

0 commit comments

Comments
 (0)