-
Notifications
You must be signed in to change notification settings - Fork 2k
Labels
bot triaged[Bot] This issue is triaged by ADK bot[Bot] This issue is triaged by ADK botweb[Component] This issue will be transferred to adk-web[Component] This issue will be transferred to adk-web
Description
Describe the bug
Multiple adk web
endpoints fail when using App objects instead of bare agents because they don't extract .root_agent
from the App.
Affected locations:
- Graph visualization endpoint (
get_event_graph
, line ~1308) - Eval execution endpoint (
run_evals
, line ~969)
To Reproduce
- Create an agent module that exports an App object:
from google.adk.apps import App
from google.adk.agents import LlmAgent
root_agent = LlmAgent(name="MyAgent", model="gemini-2.0-flash-exp")
app = App(name="MyApp", root_agent=root_agent)
- Start the web server:
adk web ./agents/
- Try to view graph visualization or run evals
- Endpoints fail because code expects
load_agent()
to return a BaseAgent but it returns an App
Expected behavior
adk web
should handle both BaseAgent and App objects by extracting .root_agent
when needed.
Fix pattern:
agent_or_app = self.agent_loader.load_agent(app_name)
# Extract root_agent if we loaded an App
if isinstance(agent_or_app, App):
root_agent = agent_or_app.root_agent
else:
root_agent = agent_or_app
Desktop:
- OS: Linux (WSL2)
- Python version: 3.13
- ADK version: main branch (post commit d5c46e4)
Model Information:
- Using LiteLLM: No
- Model: gemini-1.5-pro-002
Metadata
Metadata
Assignees
Labels
bot triaged[Bot] This issue is triaged by ADK bot[Bot] This issue is triaged by ADK botweb[Component] This issue will be transferred to adk-web[Component] This issue will be transferred to adk-web