Breaking

agent: implement actual agent transfer logic (#32)

Hyang-Ah Hana Kim
2 months ago

Commit: c6523f5

Date: July 15, 2025 at 12:46 PM

The previous PR #30 defined a custom transfertoagent

function tool which updates ToolContext so the agent

can know what agent it should transfer to. This

is a follow-up change, that made the agent actually

transfer to the requested agent.

The transfer is done by looking up the agent by the

agent name, and then invoking the agent's Run.

(Note: this results in recursive Run calls)

Depending on the last agent type, the transfer

can be automatically reversed. The reverse logic

is implemented in Runner's findagenttorun.

Since runner implementation is work-in-progress,

this change temporarily extends testAgentRunner

(in adk/llmagenttest.go) to implement the

relevant part of findagenttorun needed for

testing. Once we have the full runner implementation

we can remove much of testAgentRunner.