From 77ae61d3c2b10d938a1e080a4a39ea78c36aa789 Mon Sep 17 00:00:00 2001 From: vaibhav-patel Date: Mon, 22 Jun 2026 14:53:02 +0530 Subject: [PATCH 1/2] docs(cli): clarify AGENTS_DIR subdirectory behavior in adk web help The `adk web` and `adk api_server` help text described AGENTS_DIR as a directory "where each subdirectory is a single agent", implying every subdirectory is a valid agent. In practice `AgentLoader.list_agents()` lists all non-hidden subdirectories as candidate agents without validating them; non-agent subdirectories are simply skipped when they fail to load. Reword the AGENTS_DIR docstrings (and the matching api_server argument comment) to describe the actual behavior: each subdirectory is a candidate agent expected to contain `agent.py` (or `__init__.py`) or `root_agent.yaml`, and invalid ones are skipped on load failure. Fixes #4425. --- src/google/adk/cli/cli_tools_click.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/google/adk/cli/cli_tools_click.py b/src/google/adk/cli/cli_tools_click.py index 4ddf7a140a..601e6a7083 100644 --- a/src/google/adk/cli/cli_tools_click.py +++ b/src/google/adk/cli/cli_tools_click.py @@ -1805,9 +1805,11 @@ def cli_web( ): """Starts a FastAPI server with Web UI for agents. - AGENTS_DIR: The directory of agents (where each subdirectory is a single - agent containing `agent.py` or `root_agent.yaml` files) or a path pointing - directly to a single agent folder. + AGENTS_DIR: The directory containing your agents, or a path pointing directly + to a single agent folder. Each subdirectory is treated as a candidate agent + and is expected to contain an `agent.py` (or `__init__.py`) or a + `root_agent.yaml` file. All non-hidden subdirectories are listed; any that are + not valid agents are skipped when they fail to load. Example: @@ -1876,7 +1878,7 @@ async def _lifespan(app: FastAPI): @main.command("api_server") @feature_options() -# The directory of agents, where each subdirectory is a single agent. +# The directory containing your agents; each subdirectory is a candidate agent. # By default, it is the current working directory @click.argument( "agents_dir", @@ -1946,9 +1948,11 @@ def cli_api_server( ): """Starts a FastAPI server for agents. - AGENTS_DIR: The directory of agents (where each subdirectory is a single - agent containing `agent.py` or `root_agent.yaml` files) or a path pointing - directly to a single agent folder. + AGENTS_DIR: The directory containing your agents, or a path pointing directly + to a single agent folder. Each subdirectory is treated as a candidate agent + and is expected to contain an `agent.py` (or `__init__.py`) or a + `root_agent.yaml` file. All non-hidden subdirectories are listed; any that are + not valid agents are skipped when they fail to load. Example: From 4cbbbc9f9e5792ffd7c53b43e768adbe83d41445 Mon Sep 17 00:00:00 2001 From: vaibhav-patel Date: Mon, 22 Jun 2026 15:33:52 +0530 Subject: [PATCH 2/2] chore: re-trigger CI checks