-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix(grpc): make history_length optional #1071
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(grpc): make history_length optional #1071
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 @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_lengthfield in bothSendMessageConfigurationandGetTaskRequestgRPC messages has been updated from a requiredint32to anoptional 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.tsand JSON-RPC schemas, wherehistory_lengthis already optional. This ensuresa2aservers 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
-
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 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.
c98d4dc to
988f6d2
Compare
|
cleanup for 1.0 needs this. recommend we vote /vote |
Vote created@ToddSegal has called for a vote on The members of the following teams have binding votes:
Non-binding votes are also appreciated as a sign of support! How to voteYou can cast your vote by reacting to
Please note that voting for multiple options is not allowed and those votes won't be counted. The vote will be open for |
Vote statusSo far Summary
Binding votes (3)
|
Vote statusSo far Summary
Binding votes (3)
|
# Description The specification states that a history length of 0 should return unlimited results (see [code](https://github.com/a2aproject/A2A/blob/202aa069e66f701bacf2156d42d8916fc96a5188/specification/grpc/a2a.proto#L128-L130)). However, this was recently changed to return 0 results. This fix restores the correct behavior. Please note that there is an outstanding proposal to change this behavior. See a2aproject/A2A#1071 for more details. Prerequisites: - [x] Follow the [`CONTRIBUTING` Guide](https://github.com/a2aproject/a2a-python/blob/main/CONTRIBUTING.md). - [x] Make your Pull Request title in the <https://www.conventionalcommits.org/> specification. - Important Prefixes for [release-please](https://github.com/googleapis/release-please): - `fix:` which represents bug fixes, and correlates to a [SemVer](https://semver.org/) patch. - `feat:` represents a new feature, and correlates to a SemVer minor. - `feat!:`, or `fix!:`, `refactor!:`, etc., which represent a breaking change (indicated by the `!`) and will result in a SemVer major. - [x] Ensure the tests and linter pass (Run `bash scripts/format.sh` from the repository root to format) - [x] Appropriate docs were updated (if necessary) Fixes #<issue_number_goes_here> 🦕
Vote statusSo far Summary
Binding votes (3)
|
3 similar comments
Vote statusSo far Summary
Binding votes (3)
|
Vote statusSo far Summary
Binding votes (3)
|
Vote statusSo far Summary
Binding votes (3)
|
Vote closedThe vote did not pass.
Summary
Binding votes (3)
|
|
/vote |
Vote created@amye has called for a vote on The members of the following teams have binding votes:
Non-binding votes are also appreciated as a sign of support! How to voteYou can cast your vote by reacting to
Please note that voting for multiple options is not allowed and those votes won't be counted. The vote will be open for |
Vote statusSo far Summary
Binding votes (3)
|
1 similar comment
Vote statusSo far Summary
Binding votes (3)
|
|
@yarolegovich Be sure to rebase to main after the recent refactoring |
Vote statusSo far Summary
Binding votes (3)
|
|
Ping for this particular comment: #1071 (comment) |
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:
The change is backward-compatible and makes it possible for a2a servers to provide consistent behavior regardless of the selected transport.
Fixes #1072