Skip to content

fix: apply historyLength to SendStreamingMessage responses#983

Open
kabir wants to merge 1 commit into
a2aproject:mainfrom
kabir:issue-982
Open

fix: apply historyLength to SendStreamingMessage responses#983
kabir wants to merge 1 commit into
a2aproject:mainfrom
kabir:issue-982

Conversation

@kabir

@kabir kabir commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

The streaming path (onMessageSendStream) was not applying limitTaskHistory to Task events, causing historyLength to be silently ignored for streaming calls. Added the same limitTaskHistory call used in the non-streaming path to the streaming subscriber's onNext method.

This fixes #982

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 implements task history limiting in the streaming message path within DefaultRequestHandler and adds a corresponding integration test to verify that setting historyLength to zero returns an empty history. A review comment points out a potential bug in the underlying limitTaskHistory method where a negative historyLength (representing unlimited history) can cause an IllegalArgumentException due to out-of-bounds indices in subList. It is recommended to update limitTaskHistory to safely handle negative values.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

The streaming path (onMessageSendStream) was not applying limitTaskHistory
to Task events, causing historyLength to be silently ignored for streaming
calls. Added the same limitTaskHistory call used in the non-streaming path
to the streaming subscriber's onNext method.

This fixes a2aproject#982

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.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.

[Bug]: SendStreamingMessage ignores historyLength param

1 participant