feat(a2a-nats): introduce server A2aExecutor trait and agent_card handler - #346
Conversation
yordis
commented
Jun 19, 2026
- Server-side per-op slicing starts here: agent authors need a typed trait to implement, and each NATS subject needs its own JSON-RPC dispatch entry; landing the trait with the first operation keeps each subsequent per-op PR to a single method + handler module.
…dler Agent authors need a typed trait to implement, and each operation's NATS subject needs its own JSON-RPC dispatch entry; landing the trait together with the first operation keeps subsequent per-op PRs to a single method + handler module each. Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
PR SummaryMedium Risk Overview The handler parses JSON-RPC, defaults missing Reviewed by Cursor Bugbot for commit 5cf28e7. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
Warning Review limit reached
More reviews will be available in 51 minutes and 40 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughAdds the server-side Changesagent/getAuthenticatedExtendedCard server handler
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Code Coverage SummaryDetailsDiff against mainResults for commit: 5cf28e7 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
…pe validation failures Parse failures dropped the request id so callers couldn't correlate error replies, notifications still got responses, and AgentCard validation failures masqueraded as -32603 internal errors instead of the typed invalid_agent_response (-32006) code the protocol defines. Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e3508cb. Configure here.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@rsworkspace/crates/a2a-nats/src/server/handler.rs`:
- Around line 93-97: The `A2aExecutor` trait's `agent_card` method currently
accepts `a2a::types::GetExtendedAgentCardRequest` which is a wire/boundary type,
violating the principle of converting untrusted input exactly once. Define a
domain-specific query type (such as `AgentCardQuery`) in the domain module that
represents the query parameters needed for the agent card operation, then update
the `agent_card` method signature to accept this domain type instead of the wire
request type. The conversion from the wire `GetExtendedAgentCardRequest` to the
domain `AgentCardQuery` should happen exactly once at the boundary before
dispatching to the executor.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f4f2fd20-5292-42bf-b8fb-dd597177c342
📒 Files selected for processing (4)
rsworkspace/crates/a2a-nats/src/server/agent_card.rsrsworkspace/crates/a2a-nats/src/server/handler.rsrsworkspace/crates/a2a-nats/src/server/mod.rsrsworkspace/crates/a2a-nats/src/server/test_support.rs
…t_card extract_request_id returns None for both genuine notifications and malformed payloads (non-JSON, non-decodable id values); treating both as notifications left request-reply clients hanging until timeout when the input was simply malformed. Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
