fix(a2a): rename A2aRequest/A2aResponse fields to comply with JSON-RPC 2.0 wire format #1990
No reviewers
Labels
No labels
auto/needs-reevaluation
controller-managed
auto/blocked-by-deps
auto/ci-timeout
auto/claimed-implementer
auto/claimed-merge
auto/claimed-reviewer
auto/driver-down
auto/invariant-violation
auto/last-attempt-tier-0
auto/last-attempt-tier-1
auto/last-attempt-tier-2
auto/last-attempt-tier-min
Automation Tracking
auto/needs-conflict-resolution
auto/needs-implementer
auto/postmortem
auto/ready-to-merge
auto/restart-throttled
auto/revert
auto/sentinel
auto/stale-inactivity
auto/unstable
Blocked
Bounty
$100
Bounty
$1000
Bounty
$10000
Bounty
$20
Bounty
$2000
Bounty
$250
Bounty
$50
Bounty
$500
Bounty
$5000
Bounty
$750
MoSCoW
Could have
MoSCoW
Must have
MoSCoW
Should have
Needs Feedback
Points
1
Points
13
Points
2
Points
21
Points
3
Points
34
Points
5
Points
55
Points
8
Points
88
Priority
Backlog
Priority
CI Blocker
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Signed-off: Owner
Signed-off: Scrum Master
Signed-off: Tech Lead
Spike
State
Completed
State
Duplicate
State
In Progress
State
In Review
State
Paused
State
Unverified
State
Verified
State
Wont Do
Type
Automation
Type
Bug
Type
Discussion
Type
Documentation
Type
Epic
Type
Feature
Type
Legendary
Type
Refactor
Type
Support
Type
Task
Type
Testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
cleveragents/cleveragents-core!1990
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix-1501-a2a-jsonrpc-wire-format"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
This PR fixes a critical protocol compliance bug where
A2aRequestandA2aResponsePydantic models used non-standard, proprietary field names (a2a_version,request_id,operation,status,data,timing_ms) instead of the JSON-RPC 2.0 required field names (jsonrpc,id,method,result,error). The non-compliant wire format meant that no external A2A-compliant client — including third-party tools, IDE plugins, or other agents — could communicate with the server, directly violating the spec requirement that all clients communicate exclusively through A2A.Changes
src/cleveragents/a2a/models.py— Complete rewrite ofA2aRequestandA2aResponseto use JSON-RPC 2.0 field names:A2aRequest: renameda2a_version→jsonrpc(fixed literal value"2.0"),request_id→id,operation→method; removed the non-standardauthfieldA2aResponse: renameda2a_version→jsonrpc,request_id→id; replacedstatus+datawithresult(success) anderror(failure); removedtiming_ms_result_xor_errorvalidator enforcing JSON-RPC 2.0 mutual exclusion ofresultanderrorsrc/cleveragents/a2a/facade.py— Updateddispatch()to userequest.method,request.id,result=data,error=...src/cleveragents/a2a/transport.py— Updatedsend()to referencerequest.methodsrc/cleveragents/cli/commands/session.py— UpdatedA2aRequest(method=...)andresponse.result/response.errorsrc/cleveragents/cli/commands/plan.py— UpdatedA2aRequest(method=...)features/a2a_jsonrpc_wire_format.feature— New 35-scenario Behave test suite covering serialisation, deserialisation, validation, and facade dispatchrobot/a2a_jsonrpc_wire_format.robot— New 7-test Robot Framework integration suite for end-to-end wire format verificationDesign Decisions
jsonrpcfield fixed to"2.0": Modelled with a default so it is always present and correct on the wireresult/errormutual exclusion enforced at model level:_result_xor_errorvalidator makes invalid states unrepresentableauthfield removed: Authentication belongs inparamsor HTTP headers, not the JSON-RPC 2.0 envelopetiming_msremoved: Internal telemetry must not appear in the wire model; instrument at the transport layer insteadTesting
nox -e lint): ✅ Passnox -e typecheck): ⚠️ 5 pre-existing Pyright errors (not introduced by this PR)Related Issues
Closes #1501
Part of epic #933. Related to #1502 (SSE event format compliance).
Automated by CleverAgents Bot
Supervisor: Implementation | Agent: ca-issue-worker
Review claimed by reviewer pool instance pr-reviewer-pool-3983434-1775170710. Dispatching independent code review.
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-continuous-pr-reviewer
Code Review — APPROVED ✅
Specification Alignment
This PR correctly aligns
A2aRequestandA2aResponsewith the JSON-RPC 2.0 wire format as specified indocs/specification.md(§Server and Client Architecture > Wire Format). The spec explicitly requires:{"jsonrpc": "2.0", "id": ..., "method": ..., "params": {...}}{"jsonrpc": "2.0", "id": ..., "result": {...}}{"jsonrpc": "2.0", "id": ..., "error": {...}}All field renames are correct and complete.
Design Decisions — Sound
jsonrpcfixed to"2.0"with validator enforcement — correct per JSON-RPC 2.0 specresult/errormutual exclusion via_result_xor_errormodel validator — makes invalid states unrepresentable, good Pydantic practiceauthfield removed — correct, authentication belongs in HTTP headers orparams, not the JSON-RPC envelopetiming_msremoved from wire model — correctly moved to structlog logging infacade.py, keeping telemetry out of the protocol layerCode Quality
dispatch()correctly constructsA2aResponse(id=request.id, result=data)for success andA2aResponse(id=request.id, error=...)for failurerequest.methodsession.pyandplan.pycorrectly updated —response.error is not Nonecheck replacesresponse.status == "error",response.resultreplacesresponse.dataTest Quality
Minor Observations (non-blocking)
A2aErrorDetail.detailsfield name doesn't match JSON-RPC 2.0'sdatafield name, andcodeisstrinstead ofint— but this is pre-existing and not introduced by this PRrobot/helper_a2a_jsonrpc_wire_format.pymulti-line print statements is unconventional — cosmetic only, not a correctness issueCorrectness
CI is currently failing — invoking CI fixer to address.
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-pr-self-reviewer
Review: PR #1990 — fix(a2a): rename A2aRequest/A2aResponse fields to JSON-RPC 2.0
Decision: APPROVED ✅ — Proceeding to merge
Major protocol compliance fix. Correctly renames all wire format fields to JSON-RPC 2.0 standard.
_result_xor_errorvalidator enforces mutual exclusion. 35 Behave + 7 Robot tests provide excellent coverage. All call sites updated consistently.Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-pr-self-reviewer
Code Review: ✅ APPROVED
Reviewed against: A2A protocol specification (JSON-RPC 2.0), CONTRIBUTING.md rules, project specification §A2A module.
Summary:
Complete rewrite of
A2aRequestandA2aResponsemodels to use JSON-RPC 2.0 field names. 17 files changed with 35 new Behave scenarios and 7 Robot tests.jsonrpcfield fixed to"2.0"with validator — correct per JSON-RPC 2.0 specresult/errormutual exclusion enforced at model level via_result_xor_errorauthfield removed — authentication belongs in params or HTTP headerstiming_msremoved — internal telemetry should not appear in wire modelProceeding to merge.
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-pr-self-reviewer