Skip to content

fix(server): apply history_length to legacy streaming sends - #1364

Merged
Iwaniukooo11 merged 3 commits into
a2aproject:mainfrom
ConnorMoss02:fix/legacy-stream-history-length
Oct 22, 2026
Merged

Iwaniukooo11 merged 3 commits into
a2aproject:mainfrom
ConnorMoss02:fix/legacy-stream-history-length

Conversation

@ConnorMoss02

Copy link
Copy Markdown
Contributor

Problem

The legacy on_message_send_stream ignored history_length. Task events kept full history and negative values weren't rejected.

Fix

Validate at the top and apply it to yielded Task events, as on_message_send and the v2 stream handler do. Push notifications still get the full task.

Tests

test_on_message_send_stream_limit_history and test_on_message_send_stream_negative_history_length_error fail on main. 2289 passed.

Fixes #1363

@ConnorMoss02
ConnorMoss02 requested a review from a team as a code owner October 20, 2026 22:38
@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

🧪 Code Coverage (vs main)

⬇️ Download Full Report

Base PR Delta
src/a2a/server/request_handlers/default_request_handler.py 97.98% 97.99% 🟢 +0.02%
Total 92.90% 92.90% ⚪️ 0.00%

Generated by coverage-comment.yml

@Iwaniukooo11 Iwaniukooo11 self-assigned this Oct 21, 2026
Comment thread src/a2a/server/request_handlers/default_request_handler.py

@Iwaniukooo11 Iwaniukooo11 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@Iwaniukooo11
Iwaniukooo11 merged commit 261c074 into a2aproject:main Oct 22, 2026
17 checks passed
Superagentic-AI added a commit to SuperagenticAI/superoptix that referenced this pull request Oct 23, 2026
The streaming path ignored configuration.historyLength, so the initial Task
event always carried full history. Apply it as SendMessage does, with the same
0.3 zero-means-unlimited rule. Mirrors a2aproject/a2a-python#1364.
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.

Legacy handler ignores history_length on message/stream

2 participants