Skip to content

Conversation

@kabir
Copy link
Collaborator

@kabir kabir commented Oct 2, 2025

…ils (#318)"

This reverts commit 0165e0c from #318 since we started seeing failures on CI

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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 fully reverts a previous commit (#318) that aimed to enhance error reporting for authentication and authorization issues. The decision to revert was made due to recurring failures observed in the Continuous Integration (CI) pipeline after the original changes were introduced. This action removes the specific error handling logic and associated test cases, restoring the system to its state before the problematic commit.

Highlights

  • Revert of Authentication/Authorization Error Handling: The primary change is the complete revert of commit fix: Ensure proper errors are reported when authentication fails #318, which introduced specific error reporting for authentication and authorization failures across HTTP and gRPC transports.
  • Removal of Dedicated Test Suite: The AuthenticationAuthorizationTest.java file, containing comprehensive tests for these error scenarios, has been entirely removed.
  • Simplified Error Mapping: Custom error message constants and explicit mapping logic for HTTP 401/403 and gRPC UNAUTHENTICATED/PERMISSION_DENIED statuses have been removed from JdkA2AHttpClient and GrpcErrorMapper.
  • Dependency Clean-up: Test-scoped gRPC dependencies (a2a-java-sdk-spec-grpc, grpc-testing, grpc-inprocess) are removed from client/base/pom.xml as they are no longer needed after the test suite removal.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@kabir kabir changed the title Revert "fix: Ensure proper errors are reported when authentication fa… chore: Revert "fix: Ensure proper errors are reported when authentication fa… Oct 2, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 reverts a previous commit that introduced new authentication and authorization error handling, which was causing CI failures. The revert correctly removes the new error handling logic from the HTTP and gRPC transports, along with associated tests and utility classes. While the revert seems necessary to fix the build, I've identified a couple of issues in the code being reverted to that should be addressed to prevent future problems. Specifically, there's a potential for silent failures in asynchronous streaming requests due to missing exception handling, and a minor maintainability issue with the use of magic numbers.

Comment on lines 126 to 131
return httpClient.sendAsync(request, bodyHandler)
.thenAccept(response -> {
// Status checking is now handled in the body handler
})
.exceptionally(throwable -> {
// handle any other async errors (network issues, etc.)
subscriber.onError(new IOException("Request failed: " + throwable.getMessage(), throwable));
return null;
if (!JdkHttpResponse.success(response)) {
subscriber.onError(new IOException("Request failed " + response.statusCode()));
}
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The exceptionally() block was removed from this CompletableFuture chain as part of the revert. This is problematic because if httpClient.sendAsync() fails (e.g., due to a network error), the exception will not be propagated to the errorConsumer. The CompletableFuture returned by asyncRequest will complete exceptionally, but the subscriber's onError method will not be called, leading to silent failures for the stream consumer. Please re-add the exceptionally() block to ensure errors are correctly handled.

            return httpClient.sendAsync(request, bodyHandler)
                    .thenAccept(response -> {
                        if (!JdkHttpResponse.success(response)) {
                            subscriber.onError(new IOException("Request failed " + response.statusCode()));
                        }
                    })
                    .exceptionally(throwable -> {
                        subscriber.onError(new IOException("Request failed: " + throwable.getMessage(), throwable));
                        return null;
                    });

@kabir kabir merged commit 8815fba into a2aproject:main Oct 2, 2025
5 of 6 checks passed
fjuma added a commit to fjuma/a2a-java that referenced this pull request Oct 7, 2025
fjuma added a commit to fjuma/a2a-java that referenced this pull request Oct 7, 2025
kabir pushed a commit that referenced this pull request Oct 9, 2025
I can't reproduce the failures mentioned in
#325 so attempting to open
the PR again to see if it fails on CI.

Fixes #317
kabir added a commit to kabir/a2a-java that referenced this pull request Dec 23, 2025
…tion fa… (a2aproject#325)

…ils (a2aproject#318)"

This reverts commit 0165e0c from a2aproject#318
since we started seeing failures on CI
kabir pushed a commit to kabir/a2a-java that referenced this pull request Dec 23, 2025
…project#328)

I can't reproduce the failures mentioned in
a2aproject#325 so attempting to open
the PR again to see if it fails on CI.

Fixes a2aproject#317
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant