Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions agent-client-protocol-schema/src/v1/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4909,7 +4909,7 @@ pub enum StopReason {
///
/// This stop reason MUST be returned when the client sends a `session/cancel`
/// notification, even if the cancellation causes exceptions in underlying operations.
/// Agents SHOULD catch these exceptions and return this semantically meaningful
/// Agents MUST catch these exceptions and return this semantically meaningful
/// response to confirm successful cancellation.
Cancelled,
}
Expand Down Expand Up @@ -7301,7 +7301,9 @@ pub enum ClientNotification {
/// - Stop all language model requests as soon as possible
/// - Abort all tool call invocations in progress
/// - Send any pending `session/update` notifications
/// - Respond to the original `session/prompt` request with the `cancelled` stop reason
///
/// The Agent MUST then respond to the original `session/prompt` request with
/// the `cancelled` stop reason.
///
/// See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/v1/prompt-turn#cancellation)
CancelNotification(CancelNotification),
Expand Down
6 changes: 4 additions & 2 deletions docs/protocol/v1/draft/schema.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,9 @@ Upon receiving this notification, the Agent SHOULD:
- Stop all language model requests as soon as possible
- Abort all tool call invocations in progress
- Send any pending `session/update` notifications
- Respond to the original `session/prompt` request with the `cancelled` stop reason

The Agent MUST then respond to the original `session/prompt` request with
the `cancelled` stop reason.

See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/v1/draft/prompt-turn#cancellation)

Expand Down Expand Up @@ -9474,7 +9476,7 @@ The turn was cancelled by the client via `session/cancel`.

This stop reason MUST be returned when the client sends a `session/cancel`
notification, even if the cancellation causes exceptions in underlying operations.
Agents SHOULD catch these exceptions and return this semantically meaningful
Agents MUST catch these exceptions and return this semantically meaningful
response to confirm successful cancellation.

</ResponseField>
Expand Down
6 changes: 4 additions & 2 deletions docs/protocol/v1/schema.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,9 @@ Upon receiving this notification, the Agent SHOULD:
- Stop all language model requests as soon as possible
- Abort all tool call invocations in progress
- Send any pending `session/update` notifications
- Respond to the original `session/prompt` request with the `cancelled` stop reason

The Agent MUST then respond to the original `session/prompt` request with
the `cancelled` stop reason.

See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/v1/prompt-turn#cancellation)

Expand Down Expand Up @@ -6788,7 +6790,7 @@ The turn was cancelled by the client via `session/cancel`.

This stop reason MUST be returned when the client sends a `session/cancel`
notification, even if the cancellation causes exceptions in underlying operations.
Agents SHOULD catch these exceptions and return this semantically meaningful
Agents MUST catch these exceptions and return this semantically meaningful
response to confirm successful cancellation.

</ResponseField>
Expand Down
4 changes: 2 additions & 2 deletions schema/v1/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3575,7 +3575,7 @@
"const": "refusal"
},
{
"description": "The turn was cancelled by the client via `session/cancel`.\n\nThis stop reason MUST be returned when the client sends a `session/cancel`\nnotification, even if the cancellation causes exceptions in underlying operations.\nAgents SHOULD catch these exceptions and return this semantically meaningful\nresponse to confirm successful cancellation.",
"description": "The turn was cancelled by the client via `session/cancel`.\n\nThis stop reason MUST be returned when the client sends a `session/cancel`\nnotification, even if the cancellation causes exceptions in underlying operations.\nAgents MUST catch these exceptions and return this semantically meaningful\nresponse to confirm successful cancellation.",
"type": "string",
"const": "cancelled"
}
Expand Down Expand Up @@ -7054,7 +7054,7 @@
"anyOf": [
{
"title": "CancelNotification",
"description": "Cancels ongoing operations for a session.\n\nThis is a notification sent by the client to cancel an ongoing prompt turn.\n\nUpon receiving this notification, the Agent SHOULD:\n- Stop all language model requests as soon as possible\n- Abort all tool call invocations in progress\n- Send any pending `session/update` notifications\n- Respond to the original `session/prompt` request with the `cancelled` stop reason\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/v1/prompt-turn#cancellation)",
"description": "Cancels ongoing operations for a session.\n\nThis is a notification sent by the client to cancel an ongoing prompt turn.\n\nUpon receiving this notification, the Agent SHOULD:\n- Stop all language model requests as soon as possible\n- Abort all tool call invocations in progress\n- Send any pending `session/update` notifications\n\nThe Agent MUST then respond to the original `session/prompt` request with\nthe `cancelled` stop reason.\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/v1/prompt-turn#cancellation)",
"allOf": [
{
"$ref": "#/$defs/CancelNotification"
Expand Down
4 changes: 2 additions & 2 deletions schema/v1/schema.unstable.json
Original file line number Diff line number Diff line change
Expand Up @@ -4424,7 +4424,7 @@
"const": "refusal"
},
{
"description": "The turn was cancelled by the client via `session/cancel`.\n\nThis stop reason MUST be returned when the client sends a `session/cancel`\nnotification, even if the cancellation causes exceptions in underlying operations.\nAgents SHOULD catch these exceptions and return this semantically meaningful\nresponse to confirm successful cancellation.",
"description": "The turn was cancelled by the client via `session/cancel`.\n\nThis stop reason MUST be returned when the client sends a `session/cancel`\nnotification, even if the cancellation causes exceptions in underlying operations.\nAgents MUST catch these exceptions and return this semantically meaningful\nresponse to confirm successful cancellation.",
"type": "string",
"const": "cancelled"
}
Expand Down Expand Up @@ -9191,7 +9191,7 @@
"anyOf": [
{
"title": "CancelNotification",
"description": "Cancels ongoing operations for a session.\n\nThis is a notification sent by the client to cancel an ongoing prompt turn.\n\nUpon receiving this notification, the Agent SHOULD:\n- Stop all language model requests as soon as possible\n- Abort all tool call invocations in progress\n- Send any pending `session/update` notifications\n- Respond to the original `session/prompt` request with the `cancelled` stop reason\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/v1/draft/prompt-turn#cancellation)",
"description": "Cancels ongoing operations for a session.\n\nThis is a notification sent by the client to cancel an ongoing prompt turn.\n\nUpon receiving this notification, the Agent SHOULD:\n- Stop all language model requests as soon as possible\n- Abort all tool call invocations in progress\n- Send any pending `session/update` notifications\n\nThe Agent MUST then respond to the original `session/prompt` request with\nthe `cancelled` stop reason.\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/v1/draft/prompt-turn#cancellation)",
"allOf": [
{
"$ref": "#/$defs/CancelNotification"
Expand Down