Update

Introduce the internal parentmap. (#71)

Dmitry Pasiukevich
2 months ago

Commit: ff5f5ed

Date: August 19, 2025 at 7:27 AM

When an agent is created, adk automatically sets a parent for subagents.

This is done in the "agent" package.

For LLMAgent creation this means, it's needed to propagate "self" to

this code to ensure each subagent.Parent is set with a proper concrete

type of llmagent (and not just a base agent).

To get rid of the "self" field in the public API, we can move the agent

tree setup to an internal package, used by runner on creation.

Also, this shows an example of propagating data from runner to the

agent.

Such propagation will be done only for 2 cases:

  • agent hierarchy (created by runner, needed by LLMAgent for transfer

logic).

  • agent run config (set by users to control agents).