Skip to content

[Bug]: HTTP+JSON transport returns 501 instead of 400 for PushNotificationNotSupportedError #748

@jmesnil

Description

@jmesnil

What happened?

Summary

When push notifications are not supported, the HTTP+JSON transport returns 501 Not Implemented instead of the spec-required 400 Bad Request for PushNotificationNotSupportedError.

Requirement

Specification

The error code mappings table specifies:

Error Type JSON-RPC Code gRPC Status HTTP Status
PushNotificationNotSupportedError -32003 UNIMPLEMENTED 400 Bad Request

And Section 3.3.4 (Capability Validation):

If AgentCard.capabilities.pushNotifications is false or not present, operations related to push notification configuration (Create, Get, List, Delete) MUST return PushNotificationNotSupportedError.

Expected behavior

When the agent does not support push notifications, push notification endpoints should return HTTP 400 Bad Request with a PushNotificationNotSupportedError error body.

Actual behavior

The server returns 501 Not Implemented:

{"title":"Push Notification is not supported","details":"","status":501,"type":"https://a2a-protocol.org/errors/push-notification-not-supported"}

The error type is correct (push-notification-not-supported) but the HTTP status code is 501 instead of the spec-required 400.

Reproducer

# Confirm push notifications are not supported
curl -s http://localhost:9999/.well-known/agent-card.json | jq .capabilities.pushNotifications
# false

# Attempt to create a push notification config
curl -s -X POST http://localhost:9999/tasks/foo/pushNotificationConfigs \
  -H "Content-Type: application/json" \
  -d '{"url":"http://example.com","taskId":"foo"}'
# Returns: 501 Not Implemented
# Expected: 400 Bad Request

TCK test

tests/compatibility/http_json/test_http_status.py::TestHttpJsonStatusCodes::test_push_not_supported_returns_400

Relevant log output

Code of Conduct

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

Metadata

Metadata

Assignees

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