spec: document JSON-RPC 2.0 A2A wire format (AUTO-ARCH-8)
CI / push-validation (pull_request) Successful in 10s
CI / helm (pull_request) Successful in 25s
CI / build (pull_request) Successful in 26s
CI / lint (pull_request) Successful in 28s
CI / quality (pull_request) Successful in 53s
CI / typecheck (pull_request) Successful in 56s
CI / security (pull_request) Successful in 57s
CI / e2e_tests (pull_request) Successful in 3m19s
CI / unit_tests (pull_request) Successful in 7m21s
CI / integration_tests (pull_request) Successful in 7m23s
CI / docker (pull_request) Successful in 55s
CI / coverage (pull_request) Successful in 11m13s
CI / status-check (pull_request) Successful in 2s
CI / lint (push) Successful in 37s
CI / quality (push) Successful in 43s
CI / typecheck (push) Successful in 52s
CI / security (push) Successful in 53s
CI / build (push) Successful in 19s
CI / push-validation (push) Successful in 29s
CI / helm (push) Successful in 31s
CI / e2e_tests (push) Successful in 3m16s
CI / unit_tests (push) Successful in 7m9s
CI / integration_tests (push) Successful in 7m13s
CI / docker (push) Successful in 8s
CI / coverage (push) Successful in 10m54s
CI / status-check (push) Successful in 1s

Updates the A2A Protocol section to reflect the rename of A2aRequest/
A2aResponse fields to standard JSON-RPC 2.0 names (method, id, result,
error). Documents A2aVersionNegotiator for backward compatibility.

Closes #8787
This commit was merged in pull request #8962.
This commit is contained in:
2026-04-14 04:24:34 +00:00
parent b8732dfc6f
commit 835bc580e2
+34 -5
View File
@@ -23641,7 +23641,18 @@ sequenceDiagram
##### Wire Format
All A2A communication uses **JSON-RPC 2.0** framing:
All A2A communication uses **JSON-RPC 2.0** framing as defined by the [JSON-RPC 2.0 specification](https://www.jsonrpc.org/specification). The internal `A2aRequest` and `A2aResponse` domain objects use the **standard JSON-RPC 2.0 field names**`jsonrpc`, `method`, `id`, `params`, `result`, and `error` — ensuring full protocol compliance and interoperability with any JSON-RPC 2.0 client or tooling.
###### Envelope Field Reference
| Field | Appears In | Type | Description |
| :---- | :--------- | :--- | :---------- |
| `jsonrpc` | Request & Response | `"2.0"` (string literal) | Always `"2.0"`. Identifies the JSON-RPC protocol version. |
| `method` | Request, Notification | string | The A2A operation name (e.g. `message/send`) or `_cleveragents/` extension method. |
| `id` | Request & Response | integer \| string \| null | Correlates a response to its request. Omitted in notifications (fire-and-forget). |
| `params` | Request, Notification | object \| array | Method-specific input parameters. Always an object for CleverAgents methods. |
| `result` | Success Response | any | Present on success; mutually exclusive with `error`. |
| `error` | Error Response | object | Present on failure; mutually exclusive with `result`. Contains `code` (integer), `message` (string), and optional `data`. |
**Request:**
```json
@@ -23649,11 +23660,14 @@ All A2A communication uses **JSON-RPC 2.0** framing:
"jsonrpc": "2.0",
"id": 1,
"method": "message/send",
"params": { "message": { "role": "user", "parts": [{ "kind": "text", "text": "Refactor the auth module" }] }, "taskId": "task_01HXR..." }
"params": {
"message": { "role": "user", "parts": [{ "kind": "text", "text": "Refactor the auth module" }] },
"taskId": "task_01HXR..."
}
}
```
**Response:**
**Success response:**
```json
{
"jsonrpc": "2.0",
@@ -23662,12 +23676,16 @@ All A2A communication uses **JSON-RPC 2.0** framing:
}
```
**Streaming event (SSE via `message/stream`):**
**Streaming event (SSE notification via `message/stream`):**
```json
{
"jsonrpc": "2.0",
"method": "task/statusUpdate",
"params": { "taskId": "task_01HXR...", "status": { "state": "working" }, "message": { "role": "agent", "parts": [{ "kind": "text", "text": "I'll start by..." }] } }
"params": {
"taskId": "task_01HXR...",
"status": { "state": "working" },
"message": { "role": "agent", "parts": [{ "kind": "text", "text": "I'll start by..." }] }
}
}
```
@@ -23690,6 +23708,17 @@ All A2A communication uses **JSON-RPC 2.0** framing:
}
```
###### A2aVersionNegotiator
The `A2aVersionNegotiator` component handles backward compatibility when a client and server are running different versions of the CleverAgents A2A extension protocol. On connection establishment, the negotiator:
1. Reads the `_cleveragents.version` field from the server's Agent Card.
2. Compares it against the client's supported version range.
3. Selects the highest mutually supported minor version.
4. Downgrades the request envelope shape if the server is on an older minor version (e.g. omitting fields added in a later minor version).
This ensures that a newer CLI can still communicate with an older server (and vice versa) within the same major version, without requiring simultaneous upgrades of all components.
##### Authentication
Authentication uses HTTP auth schemes declared in the server's Agent Card: