a2aproject / a2aproject/a2a-java

[Bug]: a2a-java client sends message with empty task ID and context ID

Abierto
#770 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Java
Estrellas
490
Forks
172
Merge medio
1 d 6 h
PR fusionados (30 d)
55

Descripción

### What happened?

While investigating errors reported by https://darrelmiller.github.io/agentbin/index.html, I found out that messages sent by the A2A Java client contains empty `taskId` and `contextId`.
They look like (verbatim):

```
curl -sN -X POST https://agentbin.greensmoke-1163cb63.eastus.azurecontainerapps.io/spec \
-H "Content-Type: application/json" \
-H "Accept: text/event-stream" \
-d '{
"jsonrpc": "2.0",
"id": "839ffa13-d966-462c-88a2-136805189343",
"method": "SendStreamingMessage",
"params": {
"tenant": "",
"message": {
"messageId": "'$(uuidgen | tr '[:upper:]' '[:lower:]')'",
"taskId": "",
"contextId": "",
"role": "ROLE_USER",
"parts": [
{
"text": "task-lifecycle process this",
"metadata": {},
"filename": "",
"mediaType": ""
}
],
"metadata": {},
"extensions": [],
"referenceTaskIds": []
},
"configuration": {
"acceptedOutputModes": [],
"returnImmediately": false
},
"metadata": {}
}
}'
```

I think the .Net remote agent should reject these messages (or ignore the empty taskId) but it replies with responses such as

```
data: {"jsonrpc":"2.0","id":"839ffa13-d966-462c-88a2-136805189343","result":{"task":{"id":"","contextId":"","status":{"state":"TASK_STATE_SUBMITTED","timestamp":"2026-03-26T12:06:00.4665426+00:00"}}}}
```

which are not deserialised by the a2a-java SDK due to the empty task.id.

The a2a-java client should omit optional fields that are not set when sending messages.
If I remove the `taskId: ""` field from the reproducer, the .Net agent replies with a generated taskId as expected.

### Relevant log output

```shell

```

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.