refactor(server)!: migrate from Application wrappers to Starlette route-based endpoints for jsonrpc#873
Conversation
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 significantly refactors the server-side implementation for handling JSON-RPC and agent card endpoints. Instead of providing framework-specific application classes, the system now offers granular routing components ( 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. Footnotes
|
🧪 Code Coverage (vs
|
| Base | PR | Delta | |
|---|---|---|---|
| src/a2a/server/routes/agent_card_routes.py (new) | — | 65.00% | — |
| src/a2a/server/routes/jsonrpc_dispatcher.py (new) | — | 85.78% | — |
| src/a2a/server/routes/jsonrpc_routes.py (new) | — | 58.33% | — |
| Total | 91.45% | 91.35% | 🔴 -0.10% |
Generated by coverage-comment.yml
There was a problem hiding this comment.
Code Review
This pull request is a significant refactoring that removes the framework-specific A2AFastAPIApplication and A2AStarletteApplication in favor of a more modular approach using JsonRpcRoutes and AgentCardRoutes. This improves decoupling from web frameworks and increases flexibility. The changes are well-executed across the application and test suite. However, I've found a critical issue where a test file seems to have been missed in the refactoring, causing it to break. I've also noted some areas where test coverage might have been unintentionally reduced. Additionally, there are a few minor suggestions for improving code style and clarity.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
The pull request successfully refactors the JSON-RPC server implementation to use Starlette route-based endpoints, replacing the previous application wrappers. This change streamlines the architecture by introducing dedicated JsonRpcRoutes and AgentCardRoutes classes, which are then integrated directly into the main FastAPI/Starlette application. The removal of old application wrapper files and corresponding imports across the codebase is consistent with the refactoring goal. However, there are a couple of areas that could be improved for better encapsulation and explicit handling of request constraints.
…_json_rpc_server' into guglielmoc/refactor_json_rpc_server
Description
This PR refactors the jsonrpc server implementation to expose Starlette Route components directly (via AgentCardRoutes, JsonRpcRoutes) instead of requiring full FastAPI or Starlette application wrappers.
Ref #797 🦕