Skip to content

Conversation

@ehsavoie
Copy link
Collaborator

  • Generating new grpc specifications
  • Updating code impacted by those changes
  • Removing some unused metadata

@ehsavoie ehsavoie requested a review from kabir December 15, 2025 14:17
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ehsavoie, 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 introduces significant updates to the core a2a.proto definition, upgrading the Protocol Buffer version and integrating multi-tenancy support through a new tenant field across various API requests. It also includes a semantic renaming of agent card capabilities for better clarity and refines the handling of optional fields and exceptions. These changes ensure the API and client implementations are aligned with the updated protocol specification, improving both functionality and maintainability.

Highlights

  • Protocol Buffer Upgrade: The core a2a.proto definition has been upgraded to Protocol Buffers version 4.33.1, ensuring compatibility with the latest serialization standards.
  • Multi-Tenancy Support: A new tenant field has been introduced across various API request objects, including SendMessageRequest, GetTaskRequest, and ListTasksRequest, to enable multi-tenancy capabilities.
  • Agent Card Naming Convention Update: The field supportsAuthenticatedExtendedCard has been renamed to supportsExtendedAgentCard in the AgentCard definition and its implementations for improved clarity and consistency.
  • Refined Optional Field Handling: The handling of optional fields like historyLength in GrpcTransport.java and RestTransport.java has been refined to explicitly clear or set values based on null checks, aligning with protobuf optional field semantics.
  • Exception Handling Enhancement: Exception handling in GrpcTransport.java has been enhanced to catch StatusException in addition to StatusRuntimeException, providing more robust error management.
  • Metadata Field Removal: The metadata field has been removed from the ListTasksRequest protobuf definition and its corresponding mappers, simplifying the API contract.
  • Simplified Part Constructors: Constructors for TextPart and DataPart in the spec module have been simplified by removing the metadata parameter, streamlining their usage.
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 upgrades the a2a.proto specification, introducing multi-tenancy support and removing some unused metadata fields. The changes are extensive, affecting generated gRPC code, transport layers, and tests. The review has identified a few issues, including some critical problems with invalid JSON in test data that will likely cause test failures. There is also a potential bug in a MapStruct mapper where a new tenant field is not being correctly mapped. Additionally, some commented-out code and a TODO comment were found, which should be addressed to maintain code quality.

Comment on lines 15 to 17
{"url": "https://georoute-agent.example.com/a2a/v1", "protocolBinding": "JSONRPC", tenant=""},
{"url": "https://georoute-agent.example.com/a2a/grpc", "protocolBinding": "GRPC", tenant=""},
{"url": "https://georoute-agent.example.com/a2a/json", "protocolBinding": "HTTP+JSON", tenant=""}
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The JSON in this string is invalid. The syntax tenant="" is not valid JSON. It should be "tenant": "". This will cause JSON parsing to fail and break the tests that rely on this data.

Suggested change
{"url": "https://georoute-agent.example.com/a2a/v1", "protocolBinding": "JSONRPC", tenant=""},
{"url": "https://georoute-agent.example.com/a2a/grpc", "protocolBinding": "GRPC", tenant=""},
{"url": "https://georoute-agent.example.com/a2a/json", "protocolBinding": "HTTP+JSON", tenant=""}
{"url": "https://georoute-agent.example.com/a2a/v1", "protocolBinding": "JSONRPC", "tenant": ""},
{"url": "https://georoute-agent.example.com/a2a/grpc", "protocolBinding": "GRPC", "tenant": ""},
{"url": "https://georoute-agent.example.com/a2a/json", "protocolBinding": "HTTP+JSON", "tenant": ""}

Comment on lines 216 to 218
// if (request.tenant() != null && !request.tenant().isBlank()) {
// urlBuilder.append('/').append(request.tenant());
// }
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This commented-out code should be removed to maintain code cleanliness. If this logic is intended for future use, it should be tracked in an issue rather than being left as commented-out code in the repository.

 * Generating new grpc specifications
 * Updating code impacted by those changes
 * Removing some unused metadata

Signed-off-by: Emmanuel Hugonnet <ehugonne@redhat.com>
@kabir
Copy link
Collaborator

kabir commented Dec 16, 2025

/gemini review

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 upgrades the a2a.proto specification and applies the resulting changes across the codebase. The main changes include introducing a tenant parameter to many requests, renaming supportsAuthenticatedExtendedCard to supportsExtendedAgentCard, and removing some unused metadata fields from request parameter objects.
My review focuses on ensuring the implementation correctly reflects the new protobuf definitions. I've found a few areas for improvement:

  • A redundant else block that can be simplified.
  • An implementation detail where tenant is read from a query parameter instead of the URL path as defined in the updated proto.
  • A logic change in history limiting that makes the corresponding Javadoc outdated and could be made more robust against negative values.
    Overall, the changes are consistent with the goal of upgrading the gRPC specification.

Comment on lines +126 to +130
if(request.historyLength() != null) {
requestBuilder.setHistoryLength(request.historyLength());
} else {
requestBuilder.clearHistoryLength();
}
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 else block is redundant. Since requestBuilder is a new Builder instance, historyLength is not set by default. You can safely remove the else block to simplify the code.

        if(request.historyLength() != null) {
            requestBuilder.setHistoryLength(request.historyLength());
        }

Comment on lines +133 to +137
//TODO replace by path extraction
String tenant = rc.request().params().get("tenant");
if (tenant == null) {
tenant = "";
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

As the TODO comment indicates, the tenant parameter should be extracted from the path to align with the updated a2a.proto specification, which defines it as a path parameter (e.g., /{tenant}/tasks). The current implementation incorrectly retrieves it from query parameters.

Comment on lines +177 to +178
private static Task limitTaskHistory(Task task, @Nullable Integer historyLength) {
if (task.getHistory() == null || historyLength == null || historyLength >= task.getHistory().size()) {
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 behavior for historyLength = 0 has changed from 'unlimited' to 'zero history items'. While this is more intuitive, the Javadoc for this method is now outdated and should be updated to reflect that null means unlimited. Additionally, a negative historyLength will now cause an IllegalArgumentException from subList. For robustness, consider adding an explicit check for negative values.

@kabir kabir merged commit 7b1fa9b into a2aproject:main Dec 16, 2025
11 checks passed
@ehsavoie ehsavoie deleted the proto_update branch December 19, 2025 16:23
kabir pushed a commit to kabir/a2a-java that referenced this pull request Dec 23, 2025
* Generating new grpc specifications
 * Updating code impacted by those changes
 * Removing some unused metadata

Signed-off-by: Emmanuel Hugonnet <ehugonne@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants