Inconsistent behaviour between `adk web` vs `adk run`
the behaviour is different when running agent via run command and web command
i have following dir structure.
agent_flow
├── __init__.py
├── agent.py
init.py looks like
from . import agent
agent.py looks like
from google.adk.agents import LlmAgent
from google.adk.tools import agent_tool
root_agent = LlmAgent(
name="RefineRequest",
model="gemini-2.0-flash",
description="You are a agent that refines user requests",
instruction=(
" Your task is to refine the user request to make it more specific and actionable."
" You can split the request into smaller tasks if needed."
" You can ask clarifying questions or provide suggestions to improve the request."
),
tools=[]
)
when running a agent from a module via adk run agent_flow the agent is able to start conversation with root_agent by default but when i run adk web agent_flow the ui can not detect any agent.
To Reproduce Steps to reproduce the behaviour:
- create above project structure
- Run
adk run agent_flow - Now run
adk web agent_flow - notice the difference
Expected behaviour
the web should run with root_agent agent.
Desktop (please complete the following information):
- OS: ProductName: macOS 13.7.5
- Python version(python -V): Python 3.11.11
- ADK version(pip show google-adk): google-adk 0.3.0
Hi,
I was facing the same issue. The issue got resolved once I executed only adk web command from the root folder (in your case the folder containing agent_flow)
I ran into a similar problem. My project contains a directory with subagents like this
main_agent/
├── subagents/
│ ├── __init__.py
│ ├── subagent_1.py
│ └── subagent_2.py
├── __init__.py
└── agent.py
When running adk web main_agent it always loads subagents instead of main_agent. adk run main_agent runs correctly, however.
Hi all, you need to run adk web in the PARENT folder of your agent. @shu8hamrajput , in your case, you need to run adk web in the parent folder of agent_flow, and @rodolfo-salgado same here, run adk web in the parent folder of main_agent.
There is a troubleshoot section in the tutorial doc stating this: https://google.github.io/adk-docs/get-started/quickstart/#run-your-agent
We are looking into adding the ability for you to run adk web directly with the agent folder, but for now run the command against the parent folder will solve