-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix: old a2a url works #2626
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?
fix: old a2a url works #2626
Conversation
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.
Summary of Changes
Hello @racinmat, 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 addresses issues with A2A (Agent-to-Agent) URL handling and swagger documentation by updating the underlying framework for A2A application integration. It ensures that both existing and new agent card URLs function correctly and introduces a dedicated endpoint for OpenAPI documentation for A2A agents. The changes involve migrating to a new FastAPI-based application structure for A2A and enhancing the test suite to validate these improvements and ensure backward compatibility.
Highlights
- A2A Application Migration: The core A2A application integration has been migrated from
A2AStarletteApplication
toA2AFastAPIApplication
, leveraging FastAPI's capabilities for better API management and documentation. - New OpenAPI Documentation Endpoint: A new dedicated OpenAPI documentation endpoint is now available for A2A agents at
/a2a/{agent name}/docs
, providing clear and interactive API specifications. - Improved Test Coverage and Realism: The testing suite has been significantly enhanced by updating the A2A agent card schema in mock data and removing previous mocks, allowing tests to exercise the real A2A code paths.
- Enhanced A2A Agent Discovery and Compatibility Tests: Comprehensive tests have been added to verify A2A agent discovery, the functionality of the new OpenAPI endpoint, and backward compatibility for both current and previous agent card URLs.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
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 issue 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
-
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. ↩
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 effectively addresses the issue of old A2A URLs and the lack of a dedicated Swagger page by refactoring the A2A integration to use A2AFastAPIApplication
and mounting it as a sub-application. This is a solid improvement that leverages FastAPI's features correctly. The tests have also been improved by removing mocks and testing the actual A2A application setup, which increases confidence in the changes. I have one suggestion to improve the readability of the updated test case.
@Jacksunwei Hi, would you be so kind and review this PR? |
Thanks for the contribution! I'll let @seanzhou1023 to teak a look first. In the meanwhile, you could take a look the failing checks, as well. |
@Jacksunwei Thanks for the feedback, I addressed them. Can the tests be reran automatically so I could verify the code is ok without having to wait for human to run them? |
Fixes #2535.
Fixes #2624. Technically it's not on the same swagger page, but it introduces new endpoint
/a2a/{agent name}/docs
which has the swagger which is sufficient.I know the contribution guide tells to make 1 PR for 1 issue, but this PR fixes 2 issues, so I hope that's ok and I won't have to make 2 PRs with the same code.
testing plan
The tests can be seen in the PR.
I removed the mock to actually exercise the A2A-related code which was just silently crashing until now.
Now both old and new agent card work, and the a2a has its own swagger.
For the example from #2624, it's on page
http://localhost:8082/a2a/check_prime_agent/docs
.All relevant tests passed: