fix: Include google.rpc.ErrorInfo in gRPC error status details#738
fix: Include google.rpc.ErrorInfo in gRPC error status details#738kabir wants to merge 2 commits intoa2aproject:mainfrom
Conversation
Per specification requirement GRPC-ERR-001 (section 10.6), A2A-specific errors must include a google.rpc.ErrorInfo message in the status.details array with: - reason: A2A error type in UPPER_SNAKE_CASE without "Error" suffix - domain: "a2a-protocol.org" - metadata: Optional map of additional error context Modified GrpcHandler.handleError() to: 1. Create google.rpc.ErrorInfo with appropriate reason and domain 2. Build google.rpc.Status containing the ErrorInfo in details 3. Include Status in grpc-status-details-bin trailing metadata This ensures gRPC error responses comply with the A2A specification by providing structured error information that clients can programmatically inspect and handle. Fixes a2aproject#731 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the gRPC error handling mechanism to align with the A2A specification. By embedding structured error details, specifically Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly implements the specification requirement to include google.rpc.ErrorInfo in gRPC error status details for A2A-specific errors. The changes in GrpcHandler.handleError properly construct the ErrorInfo and attach it to the response metadata. I've added a couple of suggestions to improve code maintainability and performance within the modified handleError method.
transport/grpc/src/main/java/io/a2a/transport/grpc/handler/GrpcHandler.java
Outdated
Show resolved
Hide resolved
transport/grpc/src/main/java/io/a2a/transport/grpc/handler/GrpcHandler.java
Outdated
Show resolved
Hide resolved
|
@kabir I have a look at the v1.0.0 spec and they changed that part in a2aproject/A2A#1600. We will have to revisit it, #731 is now out of date |
|
Shouldn't we handle this at the A2AError level ? |
Per specification requirement GRPC-ERR-001 (section 10.6), A2A-specific errors must include a google.rpc.ErrorInfo message in the status.details array with:
Modified GrpcHandler.handleError() to:
This ensures gRPC error responses comply with the A2A specification by providing structured error information that clients can programmatically inspect and handle.
Fixes #731