Repository navigation
fix(rest): name an error frame in a stream "error" - #490
Merged
muscariello merged 3 commits intoNov 4, 2026
Merged
muscariello merged 3 commits into
muscariello merged 3 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
muscariello
force-pushed
the
stack/22-rest-stream-error-event
branch
from
November 3, 2026 20:52
d9ed174 to
44c1859
Compare
muscariello
force-pushed
the
stack/22-rest-stream-error-event
branch
from
November 3, 2026 22:39
44c1859 to
0a2610f
Compare
muscariello
force-pushed
the
stack/22-rest-stream-error-event
branch
from
November 4, 2026 08:16
0a2610f to
af33efa
Compare
lgecse
approved these changes
Nov 4, 2026
Signed-off-by: gulldan <[email protected]>
An error inside an HTTP+JSON stream was sent as an unnamed SSE frame carrying the google.rpc.Status body (#449). a2a-python's REST client treats a frame as an error only when its event name is "error" and reads every other frame as a StreamResponse, so the error was dropped on the floor and the consumer got an empty event instead. a2a-python's own REST server names the frame; this does the same. The JSON-RPC binding is unchanged: its error travels inside the envelope. Signed-off-by: gulldan <[email protected]>
Naming the error frame needs a serializable error type, which changed the signature of the public sse_from_stream. Leave it as it was, give rest_sse its own pub(crate) sse_from_rest_stream, and test the frame name there, so the fix is not a breaking change to a2a-server-lf. Signed-off-by: Luca Muscariello <[email protected]>
muscariello
force-pushed
the
stack/22-rest-stream-error-event
branch
from
November 4, 2026 11:57
af33efa to
728f5ff
Compare
lgecse
approved these changes
Nov 4, 2026
Merged
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.
Fixes #479. Replaces #480.
Cause: the error frame of an HTTP+JSON stream had no event name. a2a-python's REST client sends
errorto its error handler and reads any other frame as aStreamResponse, so thegoogle.rpc.Statusbody from #449 was read as an empty event and the error never reached the caller. Its REST server names the frameerror. §11.7 does not name it, so this is interoperability, not a MUST.Fix:
rest_ssesends anErritem underevent: errorthrough a newpub(crate)sse_from_rest_stream, body unchanged from #449.sse_from_streamandsse_jsonrpc_streamkeep their signatures, so nothing public changes.Tests:
test_stream_error_event_is_a_google_rpc_statusalso checks that only the error frame is namederror(onmainnone is);test_sse_from_rest_stream_names_the_error_framecovers the new function.Unproven: not run against a2a-python's client. From their source, the .NET and Go clients read only each frame's
data, so the name does not affect them.