Files
Jack Sun 9ae753b5a4 fix(tools): Add proper cleanup for AgentTool to prevent MCP session errors
Clean up runner resources in AgentTool after sub-agent execution to ensure
MCP sessions are closed in the correct async task context. Without this fix,
MCP sessions were cleaned up during garbage collection in a different task,
causing "Attempted to exit cancel scope in a different task" errors.

This fix ensures that `runner.close()` is called immediately after the
sub-agent finishes executing, properly closing all MCP sessions and other
resources within the same async task context they were created in.

Also adds two demo agents showing how to use AgentTool with MCP tools:
- mcp_in_agent_tool_remote: Uses SSE mode (remote server connection)
- mcp_in_agent_tool_stdio: Uses stdio mode (local subprocess)

Both demos use Gemini 2.5 Flash and include zero-installation setup using uvx.

Related: #1112, #929
2025-11-05 14:09:43 -08:00
..

Contributing Resources

This folder host resources for ADK contributors, for example, testing samples etc.

Samples

Samples folder host samples to test different features. The samples are usually minimal and simplistic to test one or a few scenarios.

Note: This is different from the google/adk-samples repo, which hosts more complex e2e samples for customers to use or modify directly.

ADK project and architecture overview

The adk_project_overview_and_architecture.md describes the ADK project overview and its technical architecture from high-level.

This is helpful for contributors to understand the project and design philosophy. It can also be feed into LLMs for vibe-coding.