-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Update A2A Agent Card path to expected name #4060
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @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
🧠 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 AssistThe 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
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 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
|
|
Response from ADK Triaging Agent Hello @vadakattu, thank you for submitting this pull request! To help the reviewers, could you please add a 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! |
There was a problem hiding this 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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
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 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. |
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.jsonvsagent-card.jsonSee also
a2a/utils/constants.pySolution:
updating to look for the new path
agent-card.json