-
Notifications
You must be signed in to change notification settings - Fork 133
Description
What happened?
Summary
The HTTP+JSON transport returns incorrect HTTP status codes for ContentTypeNotSupportedError (404 instead of 415) and VersionNotSupportedError (501 instead of 400 with missing Problem Details type field).
Requirement
- ID: HTTP_JSON-STATUS-001
- Section: 5.4 — A2A errors map to correct HTTP status codes
- Level: MUST
- Spec: Section 5.4 Error Code Mappings
Specification
All A2A-specific errors defined in Section 3.3.2 MUST be mapped to binding-specific error representations. The following table provides the canonical mappings for each standard protocol binding:
A2A Error Type HTTP Status ContentTypeNotSupportedError415 Unsupported Media TypeVersionNotSupportedError400 Bad Request
Expected behavior
-
When a request is sent with an unsupported
Content-Type(e.g.,text/plain), the server MUST return HTTP 415 with a Problem Details body whosetypeishttps://a2a-protocol.org/errors/content-type-not-supported. -
When a request includes an unsupported
A2A-Versionheader (e.g.,99.0), the server MUST return HTTP 400 with a Problem Details body whosetypeishttps://a2a-protocol.org/errors/version-not-supported.
Actual behavior
- ContentTypeNotSupportedError: Server returns 404 Not Found instead of 415.
- VersionNotSupportedError: Server returns 501 Not Implemented without a Problem Details
typefield, instead of 400 with proper Problem Details.
The missing type field has already been reported in #727.
Reproducer
# 1. ContentTypeNotSupportedError — expect 415, got 404
curl -s -o /dev/null -w "%{http_code}" \
-X POST http://localhost:9999/message:send \
-H "Content-Type: text/plain" \
-d '{"message": {"role": "ROLE_USER", "parts": [{"text": "ct test"}], "messageId": "tck-status-ct-004"}}'
# Expected: 415
# Actual: 404
# 2. VersionNotSupportedError — expect 400 with Problem Details, got 501
curl -s -X POST http://localhost:9999/message:send \
-H "Content-Type: application/json" \
-H "A2A-Version: 99.0" \
-d '{"message": {"role": "ROLE_USER", "parts": [{"text": "version status test"}], "messageId": "tck-status-ver-006"}}'
# Expected: 400 with {"type": "https://a2a-protocol.org/errors/version-not-supported", ...}
# Actual: 501 with no 'type' field in response bodyTCK tests
tests/compatibility/http_json/test_http_status.py::TestHttpJsonStatusCodes::test_content_type_not_supported_returns_415tests/compatibility/http_json/test_http_status.py::TestHttpJsonStatusCodes::test_version_not_supported_returns_400
Relevant log output
Code of Conduct
- I agree to follow this project's Code of Conduct