feat: Introduce PersistentAgentTool for observable agent-as-tool execution#990
Open
copybara-service[bot] wants to merge 1 commit intomainfrom
Open
feat: Introduce PersistentAgentTool for observable agent-as-tool execution#990copybara-service[bot] wants to merge 1 commit intomainfrom
copybara-service[bot] wants to merge 1 commit intomainfrom
Conversation
…ution This change introduces `PersistentAgentTool`, a new tool that allows an ADK agent to invoke another agent as a tool while enabling improved observability and state management. Unlike the existing `AgentTool`, which uses an in-memory runner for sub-agent execution, `PersistentAgentTool` is designed to be used with externally provided session and artifact services. This allows all events and state changes from the sub-agent's execution to be logged to the calling agent's session, which is critical when using persistent session storage for debugging and tracing complex, multi-step agent workflows. `PersistentAgentTool` collects all events from the sub-agent's execution, propagates all state changes back to the caller's tool context, and returns the sub-agent's final result along with a full execution trace. This enables robust orchestration patterns where one agent can decompose a task and delegate steps to other agents as tools, while maintaining full visibility into each step. PiperOrigin-RevId: 880895506
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: Introduce PersistentAgentTool for observable agent-as-tool execution
This change introduces
PersistentAgentTool, a new tool that allows an ADK agent to invoke another agent as a tool while enabling improved observability and state management.Unlike the existing
AgentTool, which uses an in-memory runner for sub-agent execution,PersistentAgentToolis designed to be used with externally provided session and artifact services. This allows all events and state changes from the sub-agent's execution to be logged to the calling agent's session, which is critical when using persistent session storage for debugging and tracing complex, multi-step agent workflows.PersistentAgentToolcollects all events from the sub-agent's execution, propagates all state changes back to the caller's tool context, and returns the sub-agent's final result along with a full execution trace. This enables robust orchestration patterns where one agent can decompose a task and delegate steps to other agents as tools, while maintaining full visibility into each step.