Skip to content

docs(cli): clarify AGENTS_DIR subdirectory behavior in adk web help#6181

Open
vaibhav-patel wants to merge 2 commits into
google:mainfrom
vaibhav-patel:fix/4425-clarify-agents-dir-help
Open

docs(cli): clarify AGENTS_DIR subdirectory behavior in adk web help#6181
vaibhav-patel wants to merge 2 commits into
google:mainfrom
vaibhav-patel:fix/4425-clarify-agents-dir-help

Conversation

@vaibhav-patel

Copy link
Copy Markdown

Summary

The adk web / adk api_server CLI help describes AGENTS_DIR as a directory "where each subdirectory is a single agent", which implies every subdirectory is a valid agent. In practice this is not the case: AgentLoader.list_agents() (in src/google/adk/cli/utils/agent_loader.py) lists all non-hidden subdirectories (only excluding .-prefixed dirs and __pycache__) as candidate agents, with no validation that they contain agent files. Non-agent subdirectories (e.g. temp folders) therefore appear in the listing and are only skipped later, when loading them fails.

This was reported in #4425, where temp folders showed up in the adk web agent dropdown.

Changes

Reword the AGENTS_DIR help text in src/google/adk/cli/cli_tools_click.py (the adk web and adk api_server docstrings, plus 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.
  • All non-hidden subdirectories are listed; subdirectories that are not valid agents are skipped when they fail to load.

Docs-only change; no behavior change. (The CLI reference docs at google.github.io/adk-docs are generated from these docstrings, so this also corrects the rendered reference.)

Verification

  • python3 -m py_compile src/google/adk/cli/cli_tools_click.py passes.
  • Confirmed the misleading "each subdirectory is a single agent" wording no longer appears in src/.

Fixes #4425.

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 google#4425.
@google-cla

google-cla Bot commented Jun 22, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@vaibhav-patel

Copy link
Copy Markdown
Author

@googlebot I signed it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clarify subdirectories listed via adk web command

1 participant