feat: A2A Version Header validation on server side.#865
Conversation
97903c4 to
027637d
Compare
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 represents a major architectural upgrade for the A2A Python SDK, focusing on full adoption of A2A Protocol v1.0. It introduces direct Protobuf usage for improved type safety and performance, alongside a robust backward compatibility layer for v0.3. Key enhancements include a standardized error handling mechanism, integration of Alembic for database migrations, and a flexible client-side interceptor pattern. These changes modernize the SDK's foundation, ensuring future extensibility and interoperability while maintaining support for existing deployments. Highlights
Ignored Files
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. Footnotes
|
🧪 Code Coverage (vs
|
| Base | PR | Delta | |
|---|---|---|---|
| src/a2a/compat/v0_3/jsonrpc_adapter.py | 31.06% | 47.01% | 🟢 +15.95% |
| src/a2a/compat/v0_3/rest_adapter.py | 36.62% | 50.70% | 🟢 +14.08% |
| src/a2a/compat/v0_3/rest_handler.py | 96.30% | 96.67% | 🟢 +0.37% |
| src/a2a/server/apps/jsonrpc/jsonrpc_app.py | 87.07% | 87.18% | 🟢 +0.11% |
| src/a2a/server/request_handlers/jsonrpc_handler.py | 92.00% | 92.50% | 🟢 +0.50% |
| src/a2a/server/request_handlers/rest_handler.py | 93.02% | 93.75% | 🟢 +0.73% |
| src/a2a/utils/error_handlers.py | 93.33% | 95.65% | 🟢 +2.32% |
| src/a2a/utils/helpers.py | 100.00% | 97.42% | 🔴 -2.58% |
| Total | 90.29% | 90.77% | 🟢 +0.48% |
Generated by coverage-comment.yml
There was a problem hiding this comment.
Code Review
This pull request introduces a new validate_version decorator to enforce API versioning based on the A2A-Version header, applying it to various JSONRPC and REST handler methods for both v0.3 compatibility and v1.0 protocols. It also significantly improves error handling for streaming responses by refactoring the rest_stream_error_handler to catch exceptions that occur during the asynchronous generation of stream content, rather than just during the initial request. Accompanying these changes are updated imports, standardized test context creation, and comprehensive new test cases to validate the versioning logic and the enhanced streaming error handling.
027637d to
9f0928b
Compare
dde1c21 to
808b923
Compare
808b923 to
ba89677
Compare
No description provided.