Skip to content

fix: UnsupportedOperationError gRPC status should be FAILED_PRECONDITION per spec #1051

Description

@kabir

Problem

The A2A specification (section 5.4) defines the following gRPC status mapping for UnsupportedOperationError:

A2A Error Type JSON-RPC Code gRPC Status HTTP Status
UnsupportedOperationError -32004 FAILED_PRECONDITION 400 Bad Request

However, A2AErrorCodes.UNSUPPORTED_OPERATION in the SDK maps to UNIMPLEMENTED:

UNSUPPORTED_OPERATION(-32004, "UNIMPLEMENTED", 400),

UNSUPPORTED_OPERATION(-32004, "UNIMPLEMENTED", 400),

This diverges from the spec table, which says the gRPC status should be FAILED_PRECONDITION.

Expected behavior

UNSUPPORTED_OPERATION should map to gRPC FAILED_PRECONDITION to match the spec.

Context

Found during review of #1041, which correctly changed streaming-not-supported errors from InvalidRequestError to UnsupportedOperationError. The gRPC status mismatch is a pre-existing issue unrelated to that PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions