Skip to content

fix(server): apply historyLength to streamed task snapshots - #463

Merged
muscariello merged 1 commit into
stack/17-keep-input-required-questionfrom
stack/18-stream-history-length
Nov 3, 2026
Merged

muscariello merged 1 commit into
stack/17-keep-input-required-questionfrom
stack/18-stream-history-length

Conversation

@muscariello

Copy link
Copy Markdown
Member

Fixes #435. Replaces #436.

Cause: send_message trims the task it returns to configuration.historyLength, but send_streaming_message returned the execution stream as it was, so every Task in the stream carried the whole history. The proto (SendMessageConfiguration.history_length) says the server MUST NOT return more messages than the value.

Fix: send_streaming_message maps the stream and trims each Task event with the same apply_history_length. Status and artifact updates carry no history and pass through.

Tests: test_streamed_task_snapshots_respect_history_length: an executor yields a Task with three history messages, and with historyLength: 1 the stream carries one. It fails with the fix reverted.

Unproven: the Python SDK trims both send and stream; the Go SDK ignores historyLength on both, so this would not match it. #436 says the A2A 1.1 handler/ split conflicts with this diff; not checked here.

@codecov

codecov Bot commented Nov 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

lgecse
lgecse previously approved these changes Nov 3, 2026
send_message trims the task it returns to configuration.historyLength,
but send_streaming_message returned the execution stream as it was, so
every Task in the stream carried the whole history. The proto binds the
cap to the response ("the server MUST NOT return more messages than the
provided value"), so the stream now trims each Task event the same way.

Signed-off-by: gulldan <5641375+gulldan@users.noreply.github.com>
@muscariello
muscariello added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit 6aae459 Nov 3, 2026
22 checks passed
@muscariello
muscariello deleted the stack/18-stream-history-length branch November 3, 2026 13:00
@github-actions github-actions Bot mentioned this pull request Nov 3, 2026
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 configuration.historyLength

3 participants