UAT: A2aErrorDetail uses field name details instead of data — violates JSON-RPC 2.0 error object schema #2564

Closed
opened 2026-04-03 18:54:58 +00:00 by freemo · 1 comment
Owner

Bug Report

Feature Area

Standards Alignment — JSON-RPC 2.0 / A2A Protocol

What Was Tested

Code-level analysis of src/cleveragents/a2a/models.py — the A2aErrorDetail model's field naming.

Expected Behavior (from spec)

The JSON-RPC 2.0 specification (§5.1) defines the error object as:

{
  "code": <integer>,
  "message": <string>,
  "data": <any>    field is named "data"
}

The optional additional information field is named data, not details.

Actual Behavior (from code)

In src/cleveragents/a2a/models.py (line 71):

class A2aErrorDetail(BaseModel):
    code: str
    message: str
    details: dict[str, Any] = {}   # ← WRONG: should be "data"

The field is named details instead of data. The docstring on the same class even correctly documents it as data:

"""Structured error payload inside an :class:`A2aResponse`.

Matches the JSON-RPC 2.0 error object structure:
``{"code": ..., "message": ..., "data": {...}}``
"""

This inconsistency means:

  1. The docstring says data but the field is details.
  2. When serialized to JSON (for wire transport), the field will appear as "details" instead of "data", breaking any JSON-RPC 2.0 compliant client.

Impact

  • Protocol non-compliance: Any JSON-RPC 2.0 or A2A client expecting error.data will find null (field missing) and lose error context.
  • Interoperability broken: Third-party A2A clients cannot access error details.
  • Inconsistency: The A2aResponse docstring (line 132) also shows "data" but the actual field serializes as "details".

Code Location

  • src/cleveragents/a2a/models.pyA2aErrorDetail.details (line 71)

Steps to Reproduce

from cleveragents.a2a.models import A2aErrorDetail
err = A2aErrorDetail(code="NOT_FOUND", message="Resource not found", details={"resource_id": "123"})
import json
wire = json.dumps(err.model_dump())
print(wire)
# Output: {"code": "NOT_FOUND", "message": "Resource not found", "details": {"resource_id": "123"}}
# Expected per JSON-RPC 2.0: {"code": -32001, "message": "Resource not found", "data": {"resource_id": "123"}}

Fix Required

Rename A2aErrorDetail.details to A2aErrorDetail.data and update all call sites in facade.py and errors.py that construct A2aErrorDetail instances.


Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-uat-tester

## Bug Report ### Feature Area Standards Alignment — JSON-RPC 2.0 / A2A Protocol ### What Was Tested Code-level analysis of `src/cleveragents/a2a/models.py` — the `A2aErrorDetail` model's field naming. ### Expected Behavior (from spec) The JSON-RPC 2.0 specification (§5.1) defines the error object as: ```json { "code": <integer>, "message": <string>, "data": <any> ← field is named "data" } ``` The optional additional information field is named **`data`**, not `details`. ### Actual Behavior (from code) In `src/cleveragents/a2a/models.py` (line 71): ```python class A2aErrorDetail(BaseModel): code: str message: str details: dict[str, Any] = {} # ← WRONG: should be "data" ``` The field is named `details` instead of `data`. The docstring on the same class even correctly documents it as `data`: ```python """Structured error payload inside an :class:`A2aResponse`. Matches the JSON-RPC 2.0 error object structure: ``{"code": ..., "message": ..., "data": {...}}`` """ ``` This inconsistency means: 1. The docstring says `data` but the field is `details`. 2. When serialized to JSON (for wire transport), the field will appear as `"details"` instead of `"data"`, breaking any JSON-RPC 2.0 compliant client. ### Impact - **Protocol non-compliance**: Any JSON-RPC 2.0 or A2A client expecting `error.data` will find `null` (field missing) and lose error context. - **Interoperability broken**: Third-party A2A clients cannot access error details. - **Inconsistency**: The `A2aResponse` docstring (line 132) also shows `"data"` but the actual field serializes as `"details"`. ### Code Location - `src/cleveragents/a2a/models.py` — `A2aErrorDetail.details` (line 71) ### Steps to Reproduce ```python from cleveragents.a2a.models import A2aErrorDetail err = A2aErrorDetail(code="NOT_FOUND", message="Resource not found", details={"resource_id": "123"}) import json wire = json.dumps(err.model_dump()) print(wire) # Output: {"code": "NOT_FOUND", "message": "Resource not found", "details": {"resource_id": "123"}} # Expected per JSON-RPC 2.0: {"code": -32001, "message": "Resource not found", "data": {"resource_id": "123"}} ``` ### Fix Required Rename `A2aErrorDetail.details` to `A2aErrorDetail.data` and update all call sites in `facade.py` and `errors.py` that construct `A2aErrorDetail` instances. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-uat-tester
Author
Owner

Closing as duplicate of #2745.

Both issues report the same bug: A2aErrorDetail uses field name details instead of JSON-RPC 2.0 required data. Issue #2745 is the canonical ticket — it has proper Metadata (branch name, commit message), Subtasks, Definition of Done, and is already linked to the correct parent Epic #933 and milestone v3.8.0.

All work should be tracked under #2745.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

Closing as duplicate of #2745. Both issues report the same bug: `A2aErrorDetail` uses field name `details` instead of JSON-RPC 2.0 required `data`. Issue #2745 is the canonical ticket — it has proper Metadata (branch name, commit message), Subtasks, Definition of Done, and is already linked to the correct parent Epic #933 and milestone v3.8.0. All work should be tracked under #2745. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#2564
No description provided.