[Bug]: Response Stream Array-Wrapping Crash (Transport Layer Mismatch)
@ishymko ci sta già lavorando.
Dal 30/6/2026.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Esamina la discrepanza nel livello di trasporto in a2a/compat/v0_3/rest_transport.py (CompatRestTransport) e a2a/client/transports/rest.py. Il problema è che il transport di compatibilità non aggiunge ?alt=sse agli URL degli endpoint di streaming, facendo sì che Google racchiuda le risposte in un array JSON. Parse del transport standard si aspetta un singolo oggetto JSON. Inizia esaminando come vengono costruiti gli URL di streaming e dove dovrebbe essere aggiunto il parametro alt=sse. Controlla la logica di parsing degli eventi SSE. «Done» significa che le risposte di streaming funzionano senza il workaround lato client.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Python
- Stelle
- 2.2k
- Fork
- 496
- Merge medio
- 1g 23h
- PR unite (30g)
- 16
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di a2aproject/a2a-python
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
a2aproject/a2a-python#1261 ·
-
component: server status:awaiting response
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
a2aproject/a2a-python#1237 · 1 commento · 1 assegnatario ·
-
[Bug]: In-memory push store keeps the caller object so later mutations rewrite stored webhooks Apertacomponent: server status:awaiting response status:stale
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
a2aproject/a2a-python#1215 · 2 commenti · 1 assegnatario ·
-
component: server status:awaiting response status:stale
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
a2aproject/a2a-python#1205 · 3 commenti · 1 assegnatario ·
-
component: server status:awaiting response status:stale
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
a2aproject/a2a-python#1204 · 2 commenti · 1 assegnatario ·
Tutte le issue di a2aproject/a2a-python
Issue simili
-
documentation help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
simonw/sqlite-utils#872 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100