Skip to content

Conversation

yarolegovich
Copy link

@yarolegovich yarolegovich commented Sep 15, 2025

Description

Both fields are optional in types.ts and jsonrpc schema.
For both cases it might be useful to differentiate 0 and unset. For example:

  1. A client calls GetTask and doesn't want History to be fetched / included in the response.
  2. A client calls SendMessage and doesn't want history to be persisted at all.

The change is backward-compatible and makes it possible for a2a servers to provide consistent behavior regardless of the selected transport.

Fixes #1072

@yarolegovich yarolegovich requested a review from a team as a code owner September 15, 2025 18:31
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.

Summary of Changes

Hello @yarolegovich, 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 enhances the flexibility of history management within the a2a system by making the history_length field optional in key gRPC message definitions: SendMessageConfiguration and GetTaskRequest. This update allows clients to precisely control whether history is fetched or persisted, differentiating between a zero value and an unset state. The change ensures consistency across various communication transports, including gRPC and JSON-RPC, and is fully backward-compatible.

Highlights

  • gRPC Field Optionality: The history_length field in both SendMessageConfiguration and GetTaskRequest gRPC messages has been updated from a required int32 to an optional int32. This allows for explicit differentiation between a zero value (e.g., unlimited history) and an unset value (e.g., no history desired).
  • Consistency Across Transports: This change aligns the gRPC specification with existing types.ts and JSON-RPC schemas, where history_length is already optional. This ensures a2a servers can provide consistent behavior regarding history handling, regardless of the communication transport used.
  • Backward Compatibility: The modification is backward-compatible, meaning existing clients will continue to function without issues, while new clients can leverage the enhanced control offered by the optional field.
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

  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 makes the history_length field optional in SendMessageConfiguration and GetTaskRequest to align with the JSON-RPC specification and provide more flexibility. The change is logical and well-justified. My review includes suggestions to improve the comments for these fields to clearly document the behavior when the field is unset, which is important for API consumers.

// The maximum number of messages to include in the history. if 0, the
// history will be unlimited.
int32 history_length = 3;
// The maximum number of messages to include in the history.
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 comment for history_length has become less informative. The previous version specified that a value of 0 means unlimited history. With the field now being optional, it's crucial to document the behavior for both unset and 0 values to avoid ambiguity for developers using this proto.

I'd suggest clarifying the semantics in the comment.

Suggested change
// The maximum number of messages to include in the history.
// The maximum number of messages to include in the history. If unset, no history is persisted; if 0, history is unlimited.

// The resource name of the task.
// Format: tasks/{task_id}
string name = 1 [(google.api.field_behavior) = REQUIRED];
// The number of most recent messages from the task's history to retrieve.
Copy link
Contributor

Choose a reason for hiding this comment

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

low

Now that history_length is optional, it would be helpful to clarify in the comment what happens when the field is not set. This improves clarity for developers using the API.

Suggested change
// The number of most recent messages from the task's history to retrieve.
// The number of most recent messages from the task's history to retrieve. If not set, no history is retrieved.

@holtskinner holtskinner added the TSC Review To be reviewed by the Technical Steering Committee label Sep 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TSC Review To be reviewed by the Technical Steering Committee
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: history length is not optional in .proto
2 participants