-
Notifications
You must be signed in to change notification settings - Fork 63
Description
Please make sure you read the contribution guide and file the issues in the
right place.
Contribution guide.
Describe the bug
When a root agent with subAgents but no tools delegates to a sub-agent using the implicit transfer_to_agent function, the conversation context (user message) is not passed correctly, resulting in an error.
Error Message
Unable to submit request because it must include at least one parts field, which describes the prompt input.
Expected Behavior (Python ADK)
In Python ADK, a root agent can have an empty tools array and successfully delegate to sub-agents:
root_agent = Agent(
name="coordinator",
model="gemini-2.0-flash",
tools=[], # Empty tools - works fine
sub_agents=[greeting_agent, farewell_agent]
)
Actual Behavior (TypeScript ADK 0.2.1)
In TypeScript ADK 0.2.1, the same pattern fails:
const rootAgent = new LlmAgent({
name: 'coordinator',
model: 'gemini-2.0-flash',
tools: [], // Empty tools - causes error
subAgents: [greetingAgent, farewellAgent]
});
To Reproduce
- Create a root agent with subAgents but empty tools array
- Create sub-agents with their own specialized tools
- Send a user message that triggers delegation
- Root agent successfully calls transfer_to_agent
- Sub-agent receives request with missing parts field → Error
Current Workaround
Add ALL sub-agent tools to the root agent's tools array:
const rootAgent = new LlmAgent({
name: 'coordinator',
tools: [tool1, tool2, tool3], // All tools from all sub-agents
subAgents: [subAgent1, subAgent2]
});
Expected behavior
The expected behaviour is when the transfer_to_agent is called the child agent should get the context and based on that it should execute the appropriate tool.
Desktop (please complete the following information):
- OS: macOS
- TS version/environment: 5.7.3
- Environment
- Package: @google/adk version ^0.2.1
- Language: TypeScript
- Model: Gemini 2.0 Flash
Impact
This prevents implementing the proper delegation pattern where the root agent is a pure orchestrator without direct tool access.
Related Documentation
Python ADK multi-agent pattern: https://google.github.io/adk-docs/tutorials/agent-team/#step-3-building-an-agent-team-delegation-for-greetings-farewells
