fix: return entire history when history_length=0#537
Conversation
Summary of ChangesHello @lkawka, 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 resolves a critical bug where the 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.
Code Review
This pull request correctly restores the specified behavior for history_length=0, ensuring that the entire task history is returned instead of an empty list. The change in src/a2a/utils/task.py is logical and directly addresses the bug. My main feedback is related to testing: the existing tests for history_length=0 were modified to test history_length=1. While this is a valid test case, it's crucial to add new, dedicated tests to verify the history_length=0 behavior to prevent future regressions of the issue this PR is fixing.
🤖 I have created a release *beep* *boop* --- ## [0.3.13](v0.3.12...v0.3.13) (2025-11-13) ### Bug Fixes * return entire history when history_length=0 ([#537](#537)) ([acdc0de](acdc0de)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Description
The specification states that a history length of 0 should return unlimited results (see code). 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:
CONTRIBUTINGGuide.fix:which represents bug fixes, and correlates to a SemVer patch.feat:represents a new feature, and correlates to a SemVer minor.feat!:, orfix!:,refactor!:, etc., which represent a breaking change (indicated by the!) and will result in a SemVer major.bash scripts/format.shfrom the repository root to format)Fixes #<issue_number_goes_here> 🦕