-
Notifications
You must be signed in to change notification settings - Fork 303
Update to specification from 61d1e3a6f9a5d497b117b746e8547156e15f1e43 #563
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
Update to specification from 61d1e3a6f9a5d497b117b746e8547156e15f1e43 #563
Conversation
Summary of ChangesHello @a2a-bot, 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 updates the A2A protocol specification, resulting in a comprehensive refresh of the generated Python protobuf and gRPC code. The changes focus on enhancing the API's structure and clarity by renaming methods and fields, introducing new functionalities like task listing, and refining data models with explicit required fields and improved documentation. This update ensures the codebase aligns with the latest protocol definition and improves overall API usability. Highlights
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
|
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 generated Python code to align with a new version of the A2A specification (commit 61d1e3a6f9a5...). The changes are mostly in auto-generated files (a2a_pb2.py, a2a_pb2.pyi, a2a_pb2_grpc.py, types.py) and correctly reflect many specification updates.
Critical Issues:
This PR is incomplete and will break the build. The gRPC service definition has changed, with several methods being renamed (e.g., TaskSubscription to SubscribeToTask, GetAgentCard to GetExtendedAgentCard) and new methods added (ListTasks). However, the client and server code that uses these definitions (src/a2a/client/transports/grpc.py and src/a2a/server/request_handlers/grpc_handler.py) have not been updated. This will cause runtime errors. All call sites and service implementations must be updated to match the new service definition.
Other Feedback:
- Performance: I've identified a potential performance regression in the generated
a2a_pb2.pyifile related to the removal of__slots__, which I've detailed in a specific comment. - Configuration: For future maintainability, it would be good practice to also update the configuration files used for code generation (
buf.gen.yamlandscripts/generate_types.sh) to point to the specific specification version (61d1e3a6f9a5...orv0.3.0) used for this update. This ensures that regenerating the code in the future will produce consistent results.
|
|
||
| class SendMessageConfiguration(_message.Message): | ||
| __slots__ = ("accepted_output_modes", "push_notification", "history_length", "blocking") | ||
| __slots__ = () |
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.
The __slots__ attribute for this class (and many others in this file, such as Task, TaskStatus, and Message) has been changed from a tuple of field names to an empty tuple (). This change effectively disables the __slots__ optimization, causing each message instance to use a __dict__ for its attributes. This will increase the memory footprint of each message object, which could be a performance concern, especially if many protobuf objects are being created in memory.
Was this change in the code generation process intentional? If it's an unintended side effect of a tool update, it would be beneficial to investigate and restore the __slots__ definitions to maintain memory efficiency.
Commit: a2aproject/A2A@61d1e3a