docs(cli): clarify AGENTS_DIR subdirectory behavior in adk web help#6181
Open
vaibhav-patel wants to merge 2 commits into
Open
docs(cli): clarify AGENTS_DIR subdirectory behavior in adk web help#6181vaibhav-patel wants to merge 2 commits into
vaibhav-patel wants to merge 2 commits into
Conversation
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.
|
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. |
Author
|
@googlebot I signed it! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
adk web/adk api_serverCLI help describesAGENTS_DIRas 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()(insrc/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 webagent dropdown.Changes
Reword the
AGENTS_DIRhelp text insrc/google/adk/cli/cli_tools_click.py(theadk webandadk api_serverdocstrings, plus the matchingapi_serverargument comment) to describe the actual behavior:agent.py(or__init__.py) orroot_agent.yaml.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.pypasses.src/.Fixes #4425.