[Bug]: Response Stream Array-Wrapping Crash (Transport Layer Mismatch)
@ishymko is already working on this.
Since Jun 30, 2026.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Look at the transport layer mismatch in a2a/compat/v0_3/rest_transport.py (CompatRestTransport) and a2a/client/transports/rest.py. The issue is that the compat transport does not append ?alt=sse to stream endpoint URLs, causing Google to wrap responses in a JSON array. The standard transport's Parse expects a single JSON object. Start by examining how stream URLs are constructed and where the alt=sse parameter should be added. Check the parsing logic for SSE events. 'Done' means streaming responses work without the client-side workaround.
Written by the indexing model from the issue text.
Description
What happened?
This is continuation from #1074 as splitting into two issues are suggested by @ishymko
Copied the issue description below for context
Response Stream Array-Wrapping Crash (Transport Layer Mismatch)
By default, Google wraps streaming RPC responses (Flow<StreamResponse>) inside a JSON array [ {"task": ...} ] to frame stream chunk boundaries on the wire.
- The Mismatch: The SDK's legacy compatibility transport (
CompatRestTransportinsidea2a/compat/v0_3/rest_transport.py) fails to request standard SSE transcoding from Google because it does not append the standard?alt=ssequery parameter to the stream endpoint URL. This forces Google to fall back to default plain JSON array-wrapped streams. - The Crash: Standard transports in
a2a/client/transports/rest.pyparse stream events using standardParse(fromgoogle.protobuf.json_format):
Because standardevent: StreamResponse = Parse(sse_data, StreamResponse())Parsestrictly expects a single JSON object{...}, the leading and trailing array brackets ([and]) causejson_format.Parseto crash immediately on the very first chunk:google.protobuf.json_format.ParseError: Failed to parse {'task': {...}} field: unhashable type: 'dict'.
Thanks for pointing this issue is not specific to v0.3 but v1 as well. Regarding the workaround mentioned in https://github.com/a2aproject/a2a-python/issues/1074#issuecomment-4555290758 , yes it will work with the workaround but this mean all the customer/developer who integrated with Google A2A APIs will require this workaround introduces developer friction. Is there any way we could make this smoother so developer can use SDK with Google A2A API out of the box? Thanks!
Code of Conduct
- I agree to follow this project's Code of Conduct
- Dominant language
- Python
- Stars
- 2.2k
- Forks
- 496
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 19
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from a2aproject/a2a-python
-
component: server status:awaiting response
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
a2aproject/a2a-python#1237 · 1 comment · 1 assignee ·
-
component: server status:awaiting response status:stale
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
a2aproject/a2a-python#1215 · 2 comments · 1 assignee ·
-
component: server status:awaiting response status:stale
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
a2aproject/a2a-python#1205 · 3 comments · 1 assignee ·
-
component: server status:awaiting response status:stale
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
a2aproject/a2a-python#1204 · 2 comments · 1 assignee ·
-
component: server
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
a2aproject/a2a-python#1192 · 3 comments · 1 assignee ·
All issues in a2aproject/a2a-python
Similar issues
-
essnmx good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
[Feature] 奇物选择添加优先级 Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
syfoud/Simulated_Scepter#174 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Giskard-AI/giskard-oss#2840 · 1 comment ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Openarea: repo bug perceived difficulty: 2
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
yeti-platform/yeti#1380 ·