fix(a2a-client): read 0.3-shaped file parts and report parts the SDK can't read

The 1.0 SDK ignores unknown part fields, so a file part shaped {kind:file, file:{bytes|uri,
name, mimeType}} arrived as an empty part and vanished. A2AWireCompat rewrites such parts
to {raw|url, filename, mediaType} in JSON and SSE responses before the SDK reads them, and
marks any part it still can't read so the result lists it with its field names.
This commit is contained in:
EugeneTes
2026-10-12 16:26:11 +00:00
parent a92623b89b
commit 6893ee8197
5 changed files with 269 additions and 1 deletions

View File

@@ -300,6 +300,11 @@ Files:
- crm.tar.gz (320000000 bytes, application/gzip): not saved, over 209715200 bytes
```
The SDK speaks protocol 1.0 and would silently drop file parts in other shapes, so every A2A response (JSON and
SSE) first passes `A2AWireCompat`: the 0.3 shape `{"kind":"file","file":{"bytes"|"uri","name","mimeType"}}` (or those
fields directly on the part) becomes `{"raw"|"url","filename","mediaType"}`, and a part it still can't read is listed
as `- part: not saved, not understood (fields: ...)` and logged with its field names (never values).
Saving a task again overwrites its folder's files, so `action=status` with the `taskId` of a finished task fetches
its files again (as long as the remote agent still returns them). Watch deliveries (`[A2A result from …]`) carry the
same list.