a2aproject / a2aproject/a2a-java

[Bug]: gRPC errors do not include google.rpc.ErrorInfo

Đang mở
#731 0 bình luận 0 reaction 1 người được giao Được @kabir nhận Xem trên GitHub
compatibility gRPC
Ngôn ngữ chính
Java
Star
490
Fork
172
Merge trung bình
1 ngày 6 giờ
Pull request đã merge (30 ngày)
55

Mô tả

### What happened?

## Summary

gRPC errors from the SUT do not include `google.rpc.ErrorInfo` in the status details, which is required by the A2A specification for all A2A-specific errors.

## Requirement

- **ID:** GRPC-ERR-001
- **Section:** 10.6 — A2A errors include ErrorInfo in status details
- **Level:** MUST
- **Spec:** https://github.com/a2aproject/A2A/blob/0833a5f5fd1b715519c0aecf9e3055e3f9f38089/docs/specification.md#106-error-handling

## Specification

> For A2A-specific errors, implementations **MUST** include a `google.rpc.ErrorInfo` message in the `status.details` array with:
> - `reason`: The A2A error type in UPPER_SNAKE_CASE without the "Error" suffix (e.g., `TASK_NOT_FOUND`)
> - `domain`: Set to `"a2a-protocol.org"`
> - `metadata`: Optional map of additional error context

## Expected behavior

When the SUT returns an A2A-specific error (e.g., `TaskNotFoundError`), the gRPC response should include a `google.rpc.Status` with a `google.rpc.ErrorInfo` message in the `details` array, encoded in the `grpc-status-details-bin` trailing metadata. The `ErrorInfo` should have `reason` set to the error type in UPPER_SNAKE_CASE (e.g., `TASK_NOT_FOUND`) and `domain` set to `"a2a-protocol.org"`.

## Actual behavior

The SUT returns a plain gRPC `NOT_FOUND` status with a message string but does **not** include `google.rpc.ErrorInfo` in the status details. The `grpc-status-details-bin` trailing metadata is missing or does not contain an `ErrorInfo` entry.

## Reproducer

```bash
# Trigger TaskNotFoundError by requesting a non-existent task
grpcurl -plaintext -d '{"id": "tck-nonexistent-task-001"}' \
localhost:9999 lf.a2a.v1.A2AService/GetTask

# Expected: gRPC NOT_FOUND with google.rpc.ErrorInfo in status.details:
# reason: "TASK_NOT_FOUND"
# domain: "a2a-protocol.org"
#
# Actual: gRPC NOT_FOUND without ErrorInfo in grpc-status-details-bin
```

## TCK test

- `tests/compatibility/core_operations/test_error_handling.py::TestGrpcErrorStructure::test_grpc_error_for_nonexistent_task`
- `tests/compatibility/grpc/test_status_codes.py::TestGrpcErrorInfo::test_error_info_in_status_details`

### Relevant log output

```shell

```

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.