You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/specification.md
+30-32Lines changed: 30 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -322,7 +322,7 @@ Specifies optional A2A protocol features supported by the agent.
322
322
--8<--"types/src/types.ts:AgentCapabilities"
323
323
```
324
324
325
-
-**`correlationIdRequired`**: When set to `true`, indicates that the agent requires clients to provide a `correlationId` field in `MessageSendParams` for all new task creation requests. This enables idempotent task creation to handle network failures and prevent duplicate operations. See [Section 7.1.2](#712-correlation-ids-and-idempotency) for detailed behavior.
325
+
-**`idempotencySupported`**: When set to `true`, indicates that the agent supports messageId-based idempotency for new task creation. This enables the agent to detect and handle duplicate `messageId` values to prevent unintended duplicate task creation due to network failures or client retries. See [Section 7.1.2](#712-messageid-based-idempotency) for detailed behavior.
326
326
327
327
#### 5.5.2.1. `AgentExtension` Object
328
328
@@ -699,7 +699,6 @@ Sends a message to an agent to initiate a new interaction or to continue an exis
699
699
{
700
700
message: Message,
701
701
configuration?: MessageSendConfiguration,
702
-
correlationId?: string,
703
702
metadata?: { [key: string]: any }
704
703
}
705
704
```
@@ -724,27 +723,29 @@ The `error` response for all transports in case of failure is a [`JSONRPCError`]
A2A supports optional correlation IDs to enable idempotent task creation, addressing scenarios where network failures or client crashes could result in duplicate tasks with unintended side effects.
728
+
A2A supports optional messageId-based idempotency to enable idempotent task creation, addressing scenarios where network failures or client crashes could result in duplicate tasks with unintended side effects.
729
+
730
+
**Scope**: Idempotency **ONLY** applies to new task creation (when `message.taskId` is not provided). Messages sent to continue existing tasks follow normal message uniqueness rules without task-level deduplication.
730
731
731
732
**Agent Requirements:**
732
-
- Agents **MAY** support correlation IDs by declaring `correlationIdRequired: true` in their `AgentCapabilities`.
733
-
- When `correlationIdRequired` is `true`, agents **MUST**require a `correlationId` field in `MessageSendParams`for all new task creation requests.
734
-
- When `correlationIdRequired` is `false` or absent, agents **MAY**ignore provided `correlationId` values.
733
+
- Agents **MAY** support idempotency by declaring `idempotencySupported: true` in their `AgentCapabilities`.
734
+
- When `idempotencySupported` is `true`, agents **MUST**track `messageId` values for new task creation within the authenticated user/session scope.
735
+
- When `idempotencySupported` is `false` or absent, agents **MAY**not support idempotency and do not track `messageId` values.
735
736
736
737
**Server Behavior:**
737
-
-**Correlation ID scope**: Correlation IDs are scoped to the authenticated user/session to prevent cross-user conflicts.
738
-
-**Active task collision**: If a `correlationId`matches an existing task in a non-terminal state (`submitted`, `working`, `input-required`), the server **MUST** return a [`CorrelationIdAlreadyExistsError`](#82-a2a-specific-errors) (-32008).
739
-
-**Terminal task reuse**: If a `correlationId` matches a task in a terminal state (`completed`, `failed`, `canceled`, `rejected`), the server **MAY** allow creating a new task with the same correlation ID.
740
-
-**Time-based expiry**: Servers **MAY** implement time-based expiry for correlation IDs associated with terminal tasks.
738
+
-**MessageId scope**: MessageId tracking is scoped to the authenticated user/session to prevent cross-user conflicts.
739
+
-**Active task collision**: If a `messageId` (for new task creation) matches an existing task in a non-terminal state (`submitted`, `working`, `input-required`), the server **MUST** return a [`MessageIdAlreadyExistsError`](#82-a2a-specific-errors) (-32008).
740
+
-**Terminal task reuse**: If a `messageId` matches a task in a terminal state (`completed`, `failed`, `canceled`, `rejected`), the server **MAY** allow creating a new task with the same messageId.
741
+
-**Time-based expiry**: Servers **MAY** implement time-based expiry for messageId tracking associated with terminal tasks.
741
742
742
743
**Client Responsibilities:**
743
-
-**Unique correlation IDs**: Clients **MUST** generate unique correlation IDs for each intended new task within their authenticated session.
744
-
-**Error handling**: When receiving `CorrelationIdAlreadyExistsError`, clients **SHOULD**:
745
-
1. Use the `existingTaskId` from the error data (if provided) to call `tasks/get`. This is the correct action when retrying a request that may have already succeeded (e.g., after a network error).
746
-
2. Alternatively, if the `correlationId` was reused unintentionally and a new, distinct task is desired, generate a new `correlationId` and retry the request.
747
-
-**Retry safety**: Clients can safely retry `message/send` requests with the same `correlationId` after network failures.
744
+
-**Unique messageIds**: Clients **MUST** generate unique `messageId` values for each intended new task within their authenticated session (this is already required by the base A2A specification).
745
+
-**Error handling**: When receiving `MessageIdAlreadyExistsError`, clients **SHOULD**:
746
+
1. Use the `existingTaskId` from the error data to call `tasks/get` to retrieve the existing task. This is the correct action when retrying a request that may have already succeeded (e.g., after a network error).
747
+
2. Alternatively, if the `messageId` was reused unintentionally and a new, distinct task is desired, generate a new `messageId` and retry the request.
748
+
-**Retry safety**: Clients can safely retry `message/send` requests with the same `messageId` after network failures when creating new tasks.
748
749
749
750
### 7.2. `message/stream`
750
751
@@ -788,7 +789,6 @@ Sends a message to an agent to initiate/continue a task AND subscribes the clien
788
789
{
789
790
message: Message,
790
791
configuration?: MessageSendConfiguration,
791
-
correlationId?: string,
792
792
metadata?: { [key: string]: any }
793
793
}
794
794
```
@@ -1199,7 +1199,7 @@ These are custom error codes defined within the JSON-RPC server error range (`-3
1199
1199
|`-32005`|`ContentTypeNotSupportedError`| Incompatible content types | A [Media Type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) provided in the request's `message.parts` (or implied for an artifact) is not supported by the agent or the specific skill being invoked. |
1200
1200
|`-32006`|`InvalidAgentResponseError`| Invalid agent response type | Agent generated an invalid response for the requested method |
1201
1201
|`-32007`|`AuthenticatedExtendedCardNotConfiguredError`| Authenticated Extended Card not configured | The agent does not have an Authenticated Extended Card configured.|
1202
-
|`-32008`|`CorrelationIdAlreadyExistsError`| Correlation ID already exists for active task | The provided `correlationId` is already associated with an active task in a non-terminal state. The client should either retrieve the existing task using the provided `existingTaskId` or generate a new correlation ID. |
1202
+
|`-32008`|`MessageIdAlreadyExistsError`| Message ID already exists for active task | The provided `messageId` is already associated with an active task in a non-terminal state. The client should either retrieve the existing task using the provided `existingTaskId` or generate a new message ID. |
1203
1203
1204
1204
Servers MAY define additional error codes within the `-32000` to `-32099` range for more specific scenarios not covered above, but they **SHOULD** document these clearly. The `data` field of the `JSONRPCError` object can be used to provide more structured details for any error.
1205
1205
@@ -1896,21 +1896,21 @@ _If the task were longer-running, the server might initially respond with `statu
1896
1896
}
1897
1897
```
1898
1898
1899
-
### 9.8. Idempotent Task Creation with Correlation IDs
1899
+
### 9.8. Idempotent Task Creation with MessageId
1900
1900
1901
1901
**Scenario:** Client needs to ensure idempotent task creation to avoid duplicate operations in case of network failures.
1902
1902
1903
-
1.**Client discovers agent requires correlation IDs from Agent Card:**
1903
+
1.**Client discovers agent supports idempotency from Agent Card:**
1904
1904
1905
1905
```json
1906
1906
{
1907
1907
"capabilities": {
1908
-
"correlationIdRequired": true
1908
+
"idempotencySupported": true
1909
1909
}
1910
1910
}
1911
1911
```
1912
1912
1913
-
2.**Client sends initial message with correlation ID:**
1913
+
2.**Client sends initial message (new task creation):**
1914
1914
1915
1915
```json
1916
1916
{
@@ -1926,9 +1926,8 @@ _If the task were longer-running, the server might initially respond with `statu
1926
1926
"text": "Process this critical financial transaction - charge card ending 1234 for $500"
0 commit comments