-
Notifications
You must be signed in to change notification settings - Fork 120
feat: Implement PushNotifications as per the 1.0 spec #622
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
Conversation
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 significantly refactors the event processing and persistence architecture to align with the A2A 1.0 specification, particularly for streaming and push notifications. The introduction of a centralized event bus and processor ensures that all client-visible events and notifications reflect a durably stored state, enhancing consistency and reliability. Resource management for streaming connections has been improved with automatic client-side closing and server-side cancellation on disconnects. These changes, along with a more robust threading model, contribute to a more scalable and compliant system. Highlights
Changelog
Activity
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 introduces a significant and well-executed architectural refactoring of the server's event processing and queueing system. The introduction of a centralized MainEventBus and a dedicated MainEventBusProcessor is a major improvement, enforcing a "persist-before-visibility" pattern that enhances robustness and eliminates potential race conditions. The changes also address critical issues like resource leaks on client disconnects and thread pool exhaustion under load, and improve compliance with the A2A specification for push notifications and event streaming. The code quality is high, with clear documentation for the new architecture. I have a couple of minor suggestions regarding code duplication in the client and a potential inconsistency in the replicated event handling logic, but overall this is an excellent set of changes.
client/transport/rest/src/main/java/io/a2a/client/transport/rest/sse/RestSSEEventListener.java
Outdated
Show resolved
Hide resolved
...ed/core/src/main/java/io/a2a/extras/queuemanager/replicated/core/ReplicatedQueueManager.java
Show resolved
Hide resolved
62e99c5 to
9414bfb
Compare
|
/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 refactors the push notification mechanism to align with the 1.0 spec, allowing any StreamingEventKind (like Task, Message, TaskStatusUpdateEvent, and TaskArtifactUpdateEvent) to be sent as a notification, instead of just Task snapshots. The changes are well-implemented across the PushNotificationSender interface and its base implementation, ensuring events are serialized correctly into the StreamResponse format. The tests have been comprehensively updated to validate the new behavior for all event types, and documentation has been improved to reflect these changes. The overall implementation is solid and enhances the push notification feature significantly. I have one minor suggestion to improve the extensibility of the BasePushNotificationSender.
server-common/src/main/java/io/a2a/server/tasks/BasePushNotificationSender.java
Outdated
Show resolved
Hide resolved
9414bfb to
23c844d
Compare
|
/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 effectively updates the push notification mechanism to align with the 1.0 specification by sending StreamingEventKind events instead of just Task snapshots. The changes are applied consistently across the interface, implementation, and test files. The test suite has been commendably expanded to cover the new event types, and backward compatibility for existing tests has been thoughtfully handled. I've included a couple of suggestions to enhance maintainability and fix a potential issue in a test helper.
server-common/src/test/java/io/a2a/server/requesthandlers/AbstractA2ARequestHandlerTest.java
Outdated
Show resolved
Hide resolved
server-common/src/main/java/io/a2a/server/tasks/BasePushNotificationSender.java
Outdated
Show resolved
Hide resolved
0634bbb to
a877f14
Compare
3d66479 to
7c760df
Compare
server-common/src/main/java/io/a2a/server/events/MainEventBusProcessor.java
Outdated
Show resolved
Hide resolved
server-common/src/main/java/io/a2a/server/tasks/BasePushNotificationSender.java
Outdated
Show resolved
Hide resolved
server-common/src/main/java/io/a2a/server/tasks/BasePushNotificationSender.java
Outdated
Show resolved
Hide resolved
135855e to
7465d78
Compare
7465d78 to
a8aa1d7
Compare
Fixes #490
Fixes: #594