[Bug]: a2a-java client sends message with empty task ID and context ID · Issue #770 · a2aproject/a2a-java · GitHub
Skip to content

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

Description

@jmesnil

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

Activity

  1. added this to the 1.0.0 milestone on Mar 26, 2026
  2. added theissue type on Mar 26, 2026
  3. added 6 commits that reference this issue on Mar 27, 2026
    73e2463
    cd13a85
    346cf01
    964df19
    c5c4c3b
    47dc31b
  4. ehsavoie commented on Mar 31, 2026

    @ehsavoie
    Collaborator

    @jmesnil I remember that there were some case where not having the parameter was different than having it but empty. Not sure if those are still valid

  5. rohansiddam commented on Oct 1, 2026

    @rohansiddam

    I have hit the blank identifier version of this in my own setup, and it is annoying because everything downstream looks almost normal. I built Synthe as a standalone packet checker, with a GitHub Action, that runs before the receiver accepts the work. I encoded this client case with an empty task ID on the handoff. It gets stopped as REJECT invalid because the handoff ID is missing. Repo link: https://github.com/rohansiddam/Synthe. If you run it on one real handoff and tell me where it breaks, that would be super helpful.

    To try it: paste the repo link into your coding agent and tell it to follow AGENTS.md. You can keep working with your agents and giving them instructions as normal; the tool checks each handoff and flags it if something is off. If you would rather run it by hand: python3 src/handoff_check.py packet.json --registry registry.json --workspace . --ledger ledger.json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions