fix(a2a): rename A2aErrorDetail.details to data per JSON-RPC 2.0 spec #3281
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!3281
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/a2a-error-detail-data-field"
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
Renames the
A2aErrorDetail.detailsfield todatato comply with the JSON-RPC 2.0 specification (§5.1), which mandates that the optional error detail field be nameddata. This was a wire-format bug causing serialized A2A error responses to emit a non-standarddetailskey instead of the spec-requireddatakey.Changes
src/cleveragents/a2a/models.py: Renamed thedetailsfield todataon theA2aErrorDetailmodel. This is the sole change required to bring the serialized JSON-RPC error object into compliance — no other call sites needed updating because all existing usages only setcodeandmessageonA2aErrorDetail, leaving the optional detail field unpopulated.features/a2a_jsonrpc_wire_format.feature: Added 3 new BDD scenarios (TDD-first) that assertA2aErrorDetailserializes with adatafield and does not emit adetailsfield, covering: presence ofdatakey, absence ofdetailskey, and correct round-trip value fidelity.features/steps/a2a_jsonrpc_wire_format_steps.py: Added corresponding Behave step definitions to support the new feature scenarios.Design Decisions
models.py. No cascading changes were needed because the optional field was not being set at any existing call site.transport.pyandevents.pyleft unchanged: Thedetails=keyword arguments in those files are constructor parameters toA2aNotAvailableError(a separate exception class), not toA2aErrorDetail. They are unrelated to this bug and were correctly left untouched to avoid unintended side effects.Testing
nox -e typecheck: 0 errors, 0 warningsModules Affected
src/cleveragents/a2a/models.py—A2aErrorDetailmodel definitionfeatures/a2a_jsonrpc_wire_format.feature— BDD feature file (3 scenarios added)features/steps/a2a_jsonrpc_wire_format_steps.py— Behave step definitionsRelated Issues
Closes #2745
Checklist
A2aErrorDetail.detailsremain in production codeAutomated by CleverAgents Bot
Supervisor: Implementation | Agent: ca-issue-worker
🔒 Review claimed by reviewer-pool-1 [claim-token: reviewer-pool-1-3281-1775374200]
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-continuous-pr-reviewer
🔒 Review claimed by reviewer-pool-1 [claim-token: reviewer-pool-1-3281-1775373000]
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-continuous-pr-reviewer
✅ Independent Code Review — Approved
Summary
This PR correctly renames
A2aErrorDetail.details→datato comply with JSON-RPC 2.0 §5.1, which mandates the optional error detail field be nameddata. The fix is surgical, well-scoped, and properly tested.Review Findings
Specification Alignment ✅
code,message, and optionallydataon error objectsdocs/reference/a2a.md§Error Code Taxonomy shows"data"in the wire format exampleA2aResponsedocstring already documented the correct"data"field name — only the model field was wrongCode Correctness ✅
models.py— minimal blast radiusA2aErrorDetail.detailsin production code (git grepconfirms)transport.pyandevents.pydetails=kwargs are correctly left untouched — they pass toA2aNotAvailableError(a separate exception class), not toA2aErrorDetaildata: dict[str, Any] = {}is safe because Pydantic v2 creates fresh copies per instanceTest Quality ✅
datakey (notdetails) with populated datadatakey present (notdetails) when no data provideddatapayloadCommit Message ✅
fix(a2a): rename A2aErrorDetail.details to data per JSON-RPC 2.0 specISSUES CLOSED: #2745Process Compliance ✅
Closes #2745Type/Buglabel presentmergestyleMinor Observations (non-blocking)
import jsonis redundantly repeated insidestep_create_error_detail_with_data()when it's already imported at the file's top level. Harmless but unnecessary.# type: ignorecomments in the step file'sexcept ImportErrorfallback block are pre-existing (not introduced by this PR) and are in test code, not production code.Verdict
Clean, correct, well-tested bug fix. No concerns. Approved for merge.
CI is currently pending — scheduling merge for when all checks pass.
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-pr-self-reviewer
Self-Review: APPROVED ✅
Summary
This PR correctly renames
A2aErrorDetail.details→datato comply with JSON-RPC 2.0 §5.1, which mandates the optional error detail field be nameddata. The fix is surgical, well-scoped, and properly tested.What was reviewed
src/cleveragents/a2a/models.py— Single-field rename fromdetailstodataonA2aErrorDetail. Clean and correct.features/a2a_jsonrpc_wire_format.feature— 3 new BDD scenarios covering: key presence (data), key absence (details), and value round-trip fidelity. Well-structured TDD approach.features/steps/a2a_jsonrpc_wire_format_steps.py— Corresponding step definitions. Correct use of regex step matcher consistent with the rest of the file.errors.py,facade.py,__init__.py, and all step files. Thedetails=parameters inerrors.pyare exception constructor args (forA2aErrorsubclasses), notA2aErrorDetailmodel fields — correctly left untouched.docs/reference/a2a.md§Error Code Taxonomy confirms the wire format uses"data"in the error object. This fix brings the model into compliance.Findings
docs/reference/a2a.mdMinor note (non-blocking)
step_create_error_detail_with_datahas a redundantimport jsoninside the function body —jsonis already imported at the top of the file. Cosmetic only.Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-pr-self-reviewer
Minor nit (non-blocking):
jsonis already imported at the top of this file (line 3). This innerimport jsonis redundant and can be removed.Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-pr-self-reviewer
Independent Code Review — PR #3281
Review Focus Areas
api-consistency, naming-conventions, code-patterns
Summary
This PR renames
A2aErrorDetail.details→datato comply with JSON-RPC 2.0 §5.1, which mandates the optional error detail field be nameddata. The fix is surgical, correct, and well-tested.Specification Alignment ✅
code,message, and optionallydata— notdetails.docs/reference/a2a.md§Error Code Taxonomy explicitly shows"data"in the example error response wire format:A2aResponsedocstring already documented the correct"data"field name — only the model field was wrong.Deep Dive: API Consistency ✅
A2aEventalready usesdata: dict[str, Any] = {}for its payload field. The rename bringsA2aErrorDetailinto naming consistency with sibling models in the same file.A2aErrorDetaildocstring already read{"code": ..., "message": ..., "data": {...}}— the field name was the only inconsistency.details=toA2aErrorDetail. Thedetails=kwargs intransport.pyandevents.pyare constructor parameters toA2aNotAvailableError(a separate exception class), correctly left untouched.Deep Dive: Naming Conventions ✅
dataaligns with the JSON-RPC 2.0 standard field name.A2aEvent.data,A2aRequest.params).fix/a2a-error-detail-data-fieldmatches the issue metadata exactly.Deep Dive: Code Patterns ✅
data: dict[str, Any] = {}is safe with Pydantic v2 (creates fresh copies per instance) — consistent with the same pattern used byA2aRequest.paramsandA2aEvent.datain the same file.__all__export list is unaffected (exports the class, not individual fields).Test Quality ✅
3 new BDD scenarios added to
features/a2a_jsonrpc_wire_format.feature:datakey present ANDdetailskey absent with populated data. Good positive+negative coverage.data, notdetails.Step definitions are well-structured with clear assertion messages for debugging. The TDD approach (tests written first) is documented and appropriate.
Process Compliance ✅
fix(a2a): rename A2aErrorDetail.details to data per JSON-RPC 2.0 specISSUES CLOSED: #2745Closes #2745Type/labelType/Bugfix/a2a-error-detail-data-fieldMinor Observations (Non-blocking)
Redundant
import jsoninstep_create_error_detail_with_data()(line ~280 of steps file) —jsonis already imported at the top of the file. Harmless but unnecessary duplication.Pre-existing
# type: ignorecomments in theexcept ImportErrorfallback block — these are present onmasterand were not introduced by this PR. They exist in test code (not production code) as a fallback for when the module isn't installed. Not a concern for this review, but worth noting for future cleanup.Verdict
Clean, correct, spec-aligned bug fix with meaningful test coverage. The rename brings
A2aErrorDetailinto consistency with both the JSON-RPC 2.0 standard and sibling models in the same file. No issues found that would block merge.Decision: APPROVED ✅
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-pr-self-reviewer