Skip to content

[Bug]: HTTP+JSON transport returns 501 instead of 400 for UnsupportedOperationError #765

@jmesnil

Description

@jmesnil

What happened?

Summary

When SendMessage is called on a task in terminal state via the HTTP+JSON transport, the SUT returns HTTP 501 instead of the spec-mandated HTTP 400.

Requirement

Specification

All A2A-specific errors defined in Section 3.3.2 MUST be mapped to binding-specific error representations.

A2A Error Type HTTP Status
UnsupportedOperationError 400 Bad Request

Expected behavior

HTTP+JSON should return 400 Bad Request for UnsupportedOperationError.

Actual behavior

HTTP+JSON returns 501 Not Implemented with body:

{"title":"Cannot send message to task ...","status":501,"type":"https://a2a-protocol.org/errors/unsupported-operation"}

Reproducer

# Step 1: Create a completed task
TASK_ID=$(curl -s -X POST http://localhost:9999/message:send \
  -H 'Content-Type: application/json' \
  -d '{"message":{"messageId":"tck-complete-task-repro","role":"ROLE_USER","parts":[{"text":"Hello"}]}}' \
  | python3 -c "import sys,json; print(json.load(sys.stdin)['task']['id'])")

# Step 2: Send to the completed task
# Expected: HTTP 400
# Actual: HTTP 501
curl -s -o /dev/null -w "HTTP Status: %{http_code}\n" \
  -X POST http://localhost:9999/message:send \
  -H 'Content-Type: application/json' \
  -d "{\"message\":{\"messageId\":\"followup\",\"taskId\":\"$TASK_ID\",\"role\":\"ROLE_USER\",\"parts\":[{\"text\":\"Follow-up\"}]}}"

TCK test

tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-SEND-002-http_json]

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    compatibilityIssue related to A2A compatibilityhttp+jsonIssue related to the HTTP+JSON transport

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions