Repository navigation
fix(client): skip stream events whose payload kind is not recognised - #770
Merged
JakubWorek merged 2 commits intoOct 14, 2026
Merged
JakubWorek merged 2 commits into
JakubWorek merged 2 commits into
Conversation
🧪 Code Coverage
Generated by coverage-comment.yml |
Contributor
Author
|
I ran the gRPC path too, which the description said I hadn't. A grpc-js server streams raw bytes into the real gRPC behaves the same as REST and JSON-RPC. I only drove |
harshitwandhare
force-pushed
the
fix/skip-unknown-stream-payloads
branch
4 times, most recently
from
October 8, 2026 13:56
c3fcd0d to
94187ee
Compare
A StreamResponse with a payload kind the SDK does not know decodes to an event with no payload, and Client yielded it to the caller. Skip it in sendMessageStream and resubscribeTask and keep reading, per the forward compatibility rule agreed in a2aproject/A2A#2269.
harshitwandhare
force-pushed
the
fix/skip-unknown-stream-payloads
branch
from
October 9, 2026 13:32
94187ee to
11bef60
Compare
JakubWorek
approved these changes
Oct 14, 2026
JakubWorek
left a comment
Member
There was a problem hiding this comment.
Thank you. Putting this check in the Client is the right spot, it covers all transports
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.
What was broken
When a server sends a
StreamResponsewith a payload kind this SDK does not know,StreamResponse.fromJSONdrops the unknown key and the client yields{ payload: undefined }to the caller. Every caller then has to special-case an event that carries nothing. Hit it with a local SSE server sendingtask, then{"futureUpdate": {...}}, thenstatusUpdate:Background
This came out of a2aproject/A2A#2269. The TSC agreed that adding a payload kind should not break existing clients, and @herczyn added wording to the bidi PR (a2aproject/A2A#2153) saying a client that gets a
StreamResponsepayload kind it does not recognise MUST skip it and keep reading the stream.What the fix does
Client.sendMessageStreamandClient.resubscribeTaskskip any event with no payload before it reaches the after-interceptors or the caller, then keep reading. Doing it inClientputs the rule in one place for every transport. I checked REST, JSON-RPC and gRPC end to end. Over gRPC, ts-proto drops the unknown field and the frame decodes to{}, so the same skip applies. TheTransportclasses are unchanged, so anyone driving a transport directly still sees the raw events.How it was verified
test/client/multitransport-client.spec.ts. ThesendMessageStreamandresubscribeTaskones fail onmain(expected [ 'task', undefined, 'task' ] to deeply equal [ 'task', 'task' ]) and pass here.RestTransport,JsonRpcTransportandGrpcTransport(sendMessageStreamonly for gRPC).npm teston2c81b86: 1844 passed on the branch, 1841 onmain. On my Windows machine both runs also fail the same sqlite push-store test, in itsafterEachcleanup (rmSyncof the temp dir getsEPERM). I installed with--ignore-scriptson both sides.npm run lint:ci,npm run build, and the workers-safe, grpc and express build checks all pass.