Skip to content

Conversation

@a2a-bot
Copy link
Collaborator

@a2a-bot a2a-bot commented Nov 21, 2025

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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

  • API Method Changes: Introduced a new ListTasks method for retrieving tasks with filtering and pagination. Existing methods TaskSubscription, CreateTaskPushNotificationConfig, and GetAgentCard have been renamed to SubscribeToTask, SetTaskPushNotificationConfig, and GetExtendedAgentCard respectively, improving clarity and consistency.
  • Data Model Refinements: Several fields across various messages have been renamed for better semantics (e.g., push_notification to push_notification_config, mime_type to media_type, content to parts, transport to protocol_binding). Many fields are now explicitly marked as required, enforcing stricter data integrity.
  • New Data Fields and Optionality: Added new fields such as reference_task_ids in Message, supported_interfaces in AgentCard, and state_transition_history in AgentCapabilities. Several fields have also been made optional, providing more flexibility in data representation.
  • Internal Python Protobuf Optimization: The __slots__ attribute has been removed from most Python protobuf message classes in the generated a2a_pb2.py and a2a_pb2.pyi files, which can impact memory usage and attribute access performance.
  • Specification Version Update: The underlying specification version referenced in src/a2a/types.py has been updated to v0.3.0, indicating a new release of the A2A protocol definition.
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.

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 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.pyi file 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.yaml and scripts/generate_types.sh) to point to the specific specification version (61d1e3a6f9a5... or v0.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__ = ()
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants