[Bug]: a2a-java client sends message with empty task ID and context ID
还没有人认领这个 Issue。
评估
调研方向
查看 A2A Java client 的消息序列化代码,该代码可能位于负责构建 JSON-RPC 请求的类中。找到设置 taskId 和 contextId 字段的位置。确保省略可选的空字段。通过发送消息并验证 JSON payload 排除空字符串来进行测试。检查 .Net agent 对空 ID 的响应处理。
由索引模型根据 Issue 内容生成。
描述
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
Code of Conduct
- I agree to follow this project's Code of Conduct
- 主要语言
- Java
- 星标
- 495
- 派生
- 174
- 平均合并
- 1 天 17 小时
- 30 天内合并 PR
- 48
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
a2aproject/a2a-java 的其他 Issue
-
[Bug]: NullPointerException in A2ACommonFieldMapper when a struct field has an explicit null value 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
a2aproject/a2a-java#1160 · 1 条评论 · 2 个 reaction ·
-
难度 2/5 1-3 小时 新手友好度 75/100
a2aproject/a2a-java#1142 · 已指派 1 人 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
a2aproject/a2a-java#1012 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
a2aproject/a2a-java#464 · 1 条评论 ·
-
sample
难度 2/5 1-3 小时 新手友好度 70/100
a2aproject/a2a-java#375 · 5 条评论 · 已指派 1 人 ·
查看 a2aproject/a2a-java 的全部 Issue
相似的 Issue
-
area-deployment area-integrations triage:bot-seen
难度 2/5 半天 新手友好度 86/100
-
难度 2/5 1-3 小时 新手友好度 75/100
apache/flink-agents#1156 ·
-
area/connectors autoteam community connectors/source/shopify needs-triage team/use type/bug
难度 2/5 1-3 小时 新手友好度 84/100
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 1/5 1 小时以内 新手友好度 85/100