refactor: use method names for JSON-RPC dispatching#932
Merged
guglielmo-san merged 9 commits into1.0-devfrom Apr 3, 2026
Merged
refactor: use method names for JSON-RPC dispatching#932guglielmo-san merged 9 commits into1.0-devfrom
guglielmo-san merged 9 commits into1.0-devfrom
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the JSON-RPC dispatcher to route requests based on the method name stored in the call context rather than the request object type. It removes the request_id parameter from internal processing methods and introduces explicit type casting for request objects. Additionally, a comprehensive test suite was added to verify the routing logic for both streaming and non-streaming methods. The review feedback suggests improving type safety and IDE support by using imported class objects directly in cast calls instead of string literals.
🧪 Code Coverage (vs
|
| Base | PR | Delta | |
|---|---|---|---|
| src/a2a/server/routes/jsonrpc_dispatcher.py | 85.23% | 85.39% | 🟢 +0.17% |
| Total | 91.88% | 91.88% | ⚪️ 0.00% |
Generated by coverage-comment.yml
ishymko
approved these changes
Apr 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR changes the routing logic in the JsonRpcDispatcher, enforcing it on the method name, rather that the object type.