Skip to content

refactor: use method names for JSON-RPC dispatching#932

Merged
guglielmo-san merged 9 commits into1.0-devfrom
guglielmoc/control_jsonrpc_routing_on_method_name
Apr 3, 2026
Merged

refactor: use method names for JSON-RPC dispatching#932
guglielmo-san merged 9 commits into1.0-devfrom
guglielmoc/control_jsonrpc_routing_on_method_name

Conversation

@guglielmo-san
Copy link
Copy Markdown
Member

Description

This PR changes the routing logic in the JsonRpcDispatcher, enforcing it on the method name, rather that the object type.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 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.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 3, 2026

🧪 Code Coverage (vs 1.0-dev)

⬇️ Download Full Report

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

@guglielmo-san guglielmo-san marked this pull request as ready for review April 3, 2026 11:12
@guglielmo-san guglielmo-san requested a review from a team as a code owner April 3, 2026 11:12
@guglielmo-san guglielmo-san requested a review from ishymko April 3, 2026 11:13
@ishymko ishymko changed the title refactor: improve JSON-RPC request handling by using method names for… refactor: use method names for JSON-RPC dispatching Apr 3, 2026
@guglielmo-san guglielmo-san enabled auto-merge (squash) April 3, 2026 15:23
@guglielmo-san guglielmo-san merged commit 677bb71 into 1.0-dev Apr 3, 2026
18 checks passed
@guglielmo-san guglielmo-san deleted the guglielmoc/control_jsonrpc_routing_on_method_name branch April 3, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants