-
Notifications
You must be signed in to change notification settings - Fork 102
feat!: Rework error classes for spec 1.0 update #558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Test the errors that were introduced since last time This also renames some error classes
Summary of ChangesHello @kabir, 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 refines the error handling and introduces robust protocol versioning to align with the A2A spec 1.0. It establishes a mechanism for clients to declare their protocol version and required extensions, which are then validated server-side. The changes ensure that communication between clients and agents adheres to specified compatibility rules and provides clearer, more structured error reporting for protocol-related issues. Highlights
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request is a significant and well-executed refactoring of the error handling mechanism. It introduces a new A2AProtocolError base class, renames AuthenticatedExtendedCardNotConfiguredError to ExtendedCardNotConfiguredError, and adds new ExtensionSupportRequiredError and VersionNotSupportedError types. These changes are consistently applied across all transport layers (gRPC, JSON-RPC, REST), improving clarity and alignment with the A2A specification. The addition of server-side validation for protocol versions and required extensions is a major improvement to the robustness of the server implementation. The test coverage for these new features is excellent, with comprehensive tests added for all transport layers. The identified minor areas for improvement related to code cleanup and consistency remain valid.
spec/src/main/java/io/a2a/spec/ExtendedCardNotConfiguredError.java
Outdated
Show resolved
Hide resolved
spec/src/main/java/io/a2a/spec/ExtensionSupportRequiredError.java
Outdated
Show resolved
Hide resolved
transport/jsonrpc/src/main/java/io/a2a/transport/jsonrpc/handler/JSONRPCHandler.java
Outdated
Show resolved
Hide resolved
transport/rest/src/main/java/io/a2a/transport/rest/handler/RestHandler.java
Outdated
Show resolved
Hide resolved
|
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a significant and well-executed rework of the error classes to align with the spec 1.0 update. Key changes include renaming AuthenticatedExtendedCardNotConfiguredError to ExtendedCardNotConfiguredError, and introducing new errors like ExtensionSupportRequiredError and VersionNotSupportedError. A new base class A2AProtocolError is added to associate protocol errors with a documentation URL, which is a great improvement for developers.
The changes are consistently applied across different transport layers (gRPC, REST, JSON-RPC), and the new validation logic for protocol versions and required extensions is correctly integrated into the request handlers. The addition of comprehensive tests for the new error mappings and validation logic is commendable.
My feedback focuses on improving the consistency of gRPC status code mappings for some of the new and updated error types to better align with gRPC best practices. Overall, this is a high-quality contribution that enhances the robustness and clarity of error handling in the SDK.
Test the errors that were introduced since last time
This also renames some error classes
Fixes #501