-
Notifications
You must be signed in to change notification settings - Fork 313
fix: Improve streaming errors handling #576
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 @lkawka, 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 mechanism for streaming operations within the client's JSONRPC and REST transports. The primary goal is to prevent the loss of critical HTTP status information when a streaming request encounters an error. By introducing explicit status checks and proper error propagation, the client can now accurately identify and respond to server-side issues during streaming, leading to more robust and reliable communication. 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 correctly refines error management for streaming operations by adding raise_for_status() to check for HTTP errors before processing the stream. The changes in send_message_streaming for both JSON-RPC and REST transports are well-implemented and are accompanied by good tests. I've added a couple of minor suggestions to make the new tests slightly more concise. One important point: this new error handling logic appears to be missing from the resubscribe methods in both src/a2a/client/transports/jsonrpc.py and src/a2a/client/transports/rest.py. Since resubscribe is also a streaming operation, I strongly recommend applying the same fix there to ensure consistent and robust error handling across all streaming endpoints.
🤖 I have created a release *beep* *boop* --- ## [0.3.20](v0.3.19...v0.3.20) (2025-12-03) ### Bug Fixes * Improve streaming errors handling ([#576](#576)) ([7ea7475](7ea7475)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Description
Refine error management for the streaming operation. Previously, errors were converted into stream parts, resulting in the loss of status info. The updated logic now first verifies if the request was successful; if it failed, a client error is returned, preserving the relevant status information.
CONTRIBUTINGGuide.fix:which represents bug fixes, and correlates to a SemVer patch.feat:represents a new feature, and correlates to a SemVer minor.feat!:, orfix!:,refactor!:, etc., which represent a breaking change (indicated by the!) and will result in a SemVer major.bash scripts/format.shfrom the repository root to format)Fixes #502 🦕