@@ -45,11 +45,13 @@ class AgentTool(BaseTool):
4545 Attributes:
4646 agent: The agent to wrap.
4747 skip_summarization: Whether to skip summarization of the agent output.
48+ include_plugins: Whether to include plugins from parent runner context
4849 """
4950
50- def __init__ (self , agent : BaseAgent , skip_summarization : bool = False ):
51+ def __init__ (self , agent : BaseAgent , skip_summarization : bool = False , include_plugins : bool = False ):
5152 self .agent = agent
5253 self .skip_summarization : bool = skip_summarization
54+ self .include_plugins = include_plugins
5355
5456 super ().__init__ (name = agent .name , description = agent .description )
5557
@@ -125,13 +127,15 @@ async def run_async(
125127 role = 'user' ,
126128 parts = [types .Part .from_text (text = args ['request' ])],
127129 )
130+ plugins = self .agent .root_agent if self .include_plugins else None
128131 runner = Runner (
129132 app_name = self .agent .name ,
130133 agent = self .agent ,
131134 artifact_service = ForwardingArtifactService (tool_context ),
132135 session_service = InMemorySessionService (),
133136 memory_service = InMemoryMemoryService (),
134137 credential_service = tool_context ._invocation_context .credential_service ,
138+ plugins = plugins
135139 )
136140 session = await runner .session_service .create_session (
137141 app_name = self .agent .name ,
0 commit comments