a2a: switch synchronous a2a_send to SSE streaming (tasks/sendSubscribe)#1219
Open
pbranchu wants to merge 2 commits into
Open
a2a: switch synchronous a2a_send to SSE streaming (tasks/sendSubscribe)#1219pbranchu wants to merge 2 commits into
pbranchu wants to merge 2 commits into
Conversation
Replace blocking tasks/send with tasks/sendSubscribe so a2a_send no longer hits the 30-second client timeout on long-running remote agents (Claude Code delegations, multi-step reasoning, etc.). The call still blocks until the remote agent emits its final event but processes SSE chunks incrementally from the wire — the response body is never buffered in memory at once, so backpressure is preserved. - Bump A2aClient timeout from 30s to 300s. - Add `send_task_streaming` to `A2aClient` (incremental SSE consumption). - Extract `process_sse_line` + `parse_sse_content` so production streaming and unit tests share one parser implementation. - `tool_a2a_send` switches to `send_task_streaming`; description updated to accurately state the 300s blocking behaviour. - Add 7 SSE parser unit tests: normal completion, mid-stream disconnect, malformed JSON skipping, no-final-event, chunk boundaries, error events, empty stream. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Switches the synchronous `a2a_send` tool from the blocking `tasks/send` JSON-RPC method to SSE-streaming `tasks/sendSubscribe`. Adds a shared `consume_sse_stream` helper used by both this PR and the forthcoming async dispatch PR.
This is the foundation PR in a three-PR series that splits the work from the closed #1066 into reviewable chunks:
Changes
Tests
7 SSE parser unit tests covering: normal completion, mid-stream disconnect, malformed JSON, missing final event, concatenated lines, error events, empty stream.
946 runtime + 503 channels tests pass on two consecutive runs (no flakes). `cargo clippy --workspace --tests --all-targets -- -D warnings` clean.
Context
This PR is what closed PR #1066 should have been on its own: a small, focused, self-contained change. The async dispatch tools and kernel refactor are split into their own PRs to keep each one reviewable.
Test plan