Skip to content

Conversation

@vadakattu
Copy link

Link to Issue or Description of Change

When using the CLI fastapi server with the --a2a flag to expose an agent for remote access, the agent card address it's looking for is out of date with the latest documentation.

1. Link to an existing issue (if applicable):

Problem:
the old path that was expected agent.json vs agent-card.json
See also a2a/utils/constants.py

Solution:
updating to look for the new path agent-card.json

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @vadakattu, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves an issue in the A2A CLI fastapi server where it failed to correctly locate agent cards due to an outdated filename expectation. By updating the code to look for "agent-card.json" instead of "agent.json", the server can now properly discover and utilize agents for remote access, ensuring consistency with current documentation and improving the reliability of the A2A functionality.

Highlights

  • Agent Card Path Correction: The expected filename for agent cards has been updated from "agent.json" to "agent-card.json".
  • A2A CLI FastAPI Server: This change specifically impacts the A2A CLI fastapi server's ability to correctly identify and load agent cards for remote access.
  • Documentation Alignment: The update ensures the codebase aligns with the latest documentation regarding agent card naming conventions.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@adk-bot
Copy link
Collaborator

adk-bot commented Jan 1, 2026

Response from ADK Triaging Agent

Hello @vadakattu, thank you for submitting this pull request!

To help the reviewers, could you please add a testing plan section to your PR description explaining how you've tested these changes?

Additionally, since this is a fix, could you please provide a log or screenshot demonstrating that the agent card path is now correctly resolved?

You can find more details in our contribution guidelines. Thanks!

@adk-bot adk-bot added the tools [Component] This issue is related to tools label Jan 1, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the A2A agent card path from agent.json to agent-card.json in src/google/adk/cli/fast_api.py, which aligns with recent documentation changes. The change is correct and follows the PR's intent.

I've added a couple of comments for your consideration:

  • A high-severity comment about updating the related tests, which seem to have been missed and will likely cause the build to fail.
  • A medium-severity comment suggesting the use of a constant for the new filename to improve maintainability.

Additionally, you may want to check if the sample agent files (e.g., in contributing/samples/) need to be renamed from agent.json to agent-card.json as part of this change, if they are intended to be used with the CLI server.

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.

)

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.

@vadakattu
Copy link
Author

vadakattu commented Jan 1, 2026

It seems there are quite a few doc pages, and samples linked which reference the old filename, despite some sporadic updates to the new filename in places

An example of a documentation page which mixes both old and new is here: https://google.github.io/adk-docs/a2a/quickstart-consuming/#overview (search for agent.json and agent-card.json references)

updates to the ADK examples in here https://github.com/google/adk-python/tree/main/contributing/samples would also be necessary.

Other option would be to clarify that for the CLI a2a utilities, agent.json is expected rather than agent-card.json as a few places state, and just call out the discrepancy with the A2A spec in how the file is ultimately exposed as agent-card.json the docs.

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

Labels

tools [Component] This issue is related to tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants