Repository navigation
fix(rest): send stream errors as google.rpc.Status - #449
Merged
muscariello merged 1 commit intoNov 2, 2026
Merged
Conversation
This was referenced Nov 1, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
muscariello
force-pushed
the
stack/10-rest-stream-error-status
branch
from
November 2, 2026 12:00
6ead462 to
3a3b324
Compare
muscariello
force-pushed
the
stack/10-rest-stream-error-status
branch
from
November 2, 2026 12:02
3a3b324 to
ebfc330
Compare
An error inside an HTTP+JSON stream went out as a bare JSON-RPC error
object, and the REST client failed to parse it, so the caller saw
"SSE parse error" (-32603) instead of the typed error. Section 11.6 says
HTTP+JSON errors use the {"error": google.rpc.Status} body. The REST
binding now sends that body as the stream event, built by the same code as
a non-streaming error response, and the REST client reads it back into the
typed A2AError, through the same parser it uses for error responses.
Signed-off-by: gulldan <[email protected]>
muscariello
force-pushed
the
stack/10-rest-stream-error-status
branch
from
November 2, 2026 14:28
ebfc330 to
9f26dd4
Compare
msardara
approved these changes
Nov 2, 2026
Merged
gulldan
added a commit
to gulldan/a2a-rs
that referenced
this pull request
Nov 3, 2026
An error inside an HTTP+JSON stream was sent as an unnamed SSE frame carrying the google.rpc.Status body (a2aproject#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. Co-Authored-By: Claude Mythos 5.1 <[email protected]> Signed-off-by: gulldan <[email protected]>
gulldan
added a commit
to gulldan/a2a-rs
that referenced
this pull request
Nov 3, 2026
An error inside an HTTP+JSON stream was sent as an unnamed SSE frame carrying the google.rpc.Status body (a2aproject#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. Co-Authored-By: Claude Mythos 5.1 <[email protected]> Signed-off-by: gulldan <[email protected]>
This was referenced Nov 3, 2026
muscariello
pushed a commit
that referenced
this pull request
Nov 3, 2026
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. Co-Authored-By: Claude Mythos 5.1 <[email protected]> Signed-off-by: gulldan <[email protected]>
muscariello
pushed a commit
that referenced
this pull request
Nov 3, 2026
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. Co-Authored-By: Claude Mythos 5.1 <[email protected]> Signed-off-by: gulldan <[email protected]>
muscariello
pushed a commit
that referenced
this pull request
Nov 4, 2026
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]>
muscariello
pushed a commit
that referenced
this pull request
Nov 4, 2026
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]>
gulldan
added a commit
to gulldan/a2a-rs
that referenced
this pull request
Nov 4, 2026
* test(rest): stream error event name Signed-off-by: gulldan <[email protected]> * fix(rest): name an error frame in a stream "error" An error inside an HTTP+JSON stream was sent as an unnamed SSE frame carrying the google.rpc.Status body (a2aproject#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]> * fix(rest): keep sse_from_stream's signature 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]> --------- Signed-off-by: gulldan <[email protected]> Signed-off-by: Luca Muscariello <[email protected]> Co-authored-by: gulldan <[email protected]>
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 #421. Replaces #422. Stacked on #448: review only the last commit.
Cause: an error inside an HTTP+JSON stream went out as a bare JSON-RPC error object, against §11.6. The REST client parsed every event as a
StreamResponse, so a typed error such asTaskNotFoundreached the caller as-32603 SSE parse error.Fix: the two REST stream handlers now send an error item as the event
{"error": google.rpc.Status}, built byrest_error_envelope, the same body a non-streaming REST error already has. In the client,parse_sse_stream_restreads that envelope back into the typedA2AErrorthroughrest_error. AStreamResponsenever has a top-levelerrorkey.sse::sse_from_streamis unchanged.Behavior change: the wire shape of an error event on REST streams changes. A client that parsed the old JSON-RPC-shaped error event will no longer match it.
Tests: one server test checks the error event has
error.code: 404,status: NOT_FOUNDand reasonTASK_NOT_FOUND; one client test decodes such an event toTaskNotFound.Unproven: the failure on
mainquoted in #422 was not run locally. CI is the check.