Describe the bug
With the latest Maven Central release, 1.2.0.Final, the v0.3 HTTP+JSON client accepts an initial WORKING task but fails when polling the completed task if an artifact contains a file name.
The failure is:
org.a2aproject.sdk.compat03.spec.A2AClientException_v0_3:
Failed to get task: com.google.protobuf.InvalidProtocolBufferException:
Cannot find field: name in message a2a.v1.FilePart
Environment
- A2A Java SDK:
1.2.0.Final
- Modules:
a2a-java-sdk-compat-0.3-client
a2a-java-sdk-compat-0.3-client-transport-rest
- Protocol advertised by the server:
0.3.0
- Preferred transport:
HTTP+JSON
- JDK used for the minimal reproducer:
25.0.2
Reproduction
- Resolve a v0.3 Agent Card advertising
HTTP+JSON.
- Build a
Client_v0_3 with RestTransport_v0_3.
- Send a
Message_v0_3.
- The initial task response is parsed successfully and has state
WORKING.
- Poll it with:
client.getTask(
new TaskQueryParams_v0_3(taskId),
new ClientCallContext_v0_3(Map.of(), Map.of())
);
- Once the task is complete, the server returns an artifact containing this valid v0.3 file object:
{
"artifacts": [
{
"artifactId": "html-report",
"name": "report.html",
"parts": [
{
"file": {
"fileWithBytes": "PGh0bWw+Li4uPC9odG1sPg==",
"mimeType": "text/html",
"name": "report.html"
}
}
]
}
]
}
The poll then fails in RestTransport_v0_3.getTask() while merging ProtoJSON.
Expected behavior
The completed task should be parsed successfully and the file name should be preserved as FileWithBytes_v0_3.name.
The A2A v0.3 specification defines FileBase.name as an optional field:
https://a2a-protocol.org/v0.3.0/specification/#66-filebase-object
Suspected regression
The current compatibility Proto does not contain FilePart.name:
https://github.com/a2aproject/a2a-java/blob/main/compat-0.3/spec-grpc/src/main/proto/a2a.proto#L213-L219
Its domain record already supports the value:
FileWithBytes_v0_3(String mimeType, String name, String bytes)
but ProtoUtils_v0_3.FromProto.filePart() currently supplies null for the name.
This field was previously reported in #364 and added to the old spec-grpc module by #392, but the fix appears not to have been carried into the later compat-0.3/spec-grpc module.
Suggested fix
- Add
string name = 4; to the compat-0.3 FilePart Proto.
- Preserve
name and mime_type in both directions in ProtoUtils_v0_3.
- Add an HTTP+JSON polling test whose completed task contains a named
FileWithBytes artifact.
This is reproducible against a real official-SDK-based v0.3 server; request submission and task execution both succeed, and only final task decoding fails.
Describe the bug
With the latest Maven Central release,
1.2.0.Final, the v0.3 HTTP+JSON client accepts an initialWORKINGtask but fails when polling the completed task if an artifact contains a file name.The failure is:
Environment
1.2.0.Finala2a-java-sdk-compat-0.3-clienta2a-java-sdk-compat-0.3-client-transport-rest0.3.0HTTP+JSON25.0.2Reproduction
HTTP+JSON.Client_v0_3withRestTransport_v0_3.Message_v0_3.WORKING.{ "artifacts": [ { "artifactId": "html-report", "name": "report.html", "parts": [ { "file": { "fileWithBytes": "PGh0bWw+Li4uPC9odG1sPg==", "mimeType": "text/html", "name": "report.html" } } ] } ] }The poll then fails in
RestTransport_v0_3.getTask()while merging ProtoJSON.Expected behavior
The completed task should be parsed successfully and the file name should be preserved as
FileWithBytes_v0_3.name.The A2A v0.3 specification defines
FileBase.nameas an optional field:https://a2a-protocol.org/v0.3.0/specification/#66-filebase-object
Suspected regression
The current compatibility Proto does not contain
FilePart.name:https://github.com/a2aproject/a2a-java/blob/main/compat-0.3/spec-grpc/src/main/proto/a2a.proto#L213-L219
Its domain record already supports the value:
but
ProtoUtils_v0_3.FromProto.filePart()currently suppliesnullfor the name.This field was previously reported in #364 and added to the old
spec-grpcmodule by #392, but the fix appears not to have been carried into the latercompat-0.3/spec-grpcmodule.Suggested fix
string name = 4;to the compat-0.3FilePartProto.nameandmime_typein both directions inProtoUtils_v0_3.FileWithBytesartifact.This is reproducible against a real official-SDK-based v0.3 server; request submission and task execution both succeed, and only final task decoding fails.