Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/google/adk/cli/fast_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,12 +344,12 @@ async def _get_a2a_runner_async() -> Runner:
return _get_a2a_runner_async

for p in base_path.iterdir():
# only folders with an agent.json file representing agent card are valid
# only folders with an agent-card.json file representing agent card are valid
# a2a agents
if (
p.is_file()
or p.name.startswith((".", "__pycache__"))
or not (p / "agent.json").is_file()
or not (p / "agent-card.json").is_file()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This change from agent.json to agent-card.json is correct. However, it seems the corresponding test setup has not been updated. The temp_agents_dir_with_a2a fixture in tests/unittests/cli/test_fast_api.py still creates agent.json. This will likely cause test_a2a_agent_discovery to fail. Please update the test to create agent-card.json.

):
continue

Expand All @@ -365,7 +365,7 @@ async def _get_a2a_runner_async() -> Runner:
agent_executor=agent_executor, task_store=a2a_task_store
)

with (p / "agent.json").open("r", encoding="utf-8") as f:
with (p / "agent-card.json").open("r", encoding="utf-8") as f:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To improve maintainability and avoid magic strings, it would be best to define "agent-card.json" as a constant and reuse it. As this filename is also checked on line 352, defining a constant (e.g., in a2a/utils/constants.py as hinted in the PR description) would ensure consistency.

data = json.load(f)
agent_card = AgentCard(**data)

Expand Down