diff --git a/agent-client-protocol-schema/src/v1/agent.rs b/agent-client-protocol-schema/src/v1/agent.rs index b07020967..a6064e1bf 100644 --- a/agent-client-protocol-schema/src/v1/agent.rs +++ b/agent-client-protocol-schema/src/v1/agent.rs @@ -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, } @@ -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), diff --git a/docs/protocol/v1/draft/schema.mdx b/docs/protocol/v1/draft/schema.mdx index 29424a822..6c261960c 100644 --- a/docs/protocol/v1/draft/schema.mdx +++ b/docs/protocol/v1/draft/schema.mdx @@ -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) @@ -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. diff --git a/docs/protocol/v1/schema.mdx b/docs/protocol/v1/schema.mdx index 65166b886..ab0e69d68 100644 --- a/docs/protocol/v1/schema.mdx +++ b/docs/protocol/v1/schema.mdx @@ -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) @@ -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. diff --git a/schema/v1/schema.json b/schema/v1/schema.json index b20a7d4f5..40e5a3115 100644 --- a/schema/v1/schema.json +++ b/schema/v1/schema.json @@ -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" } @@ -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" diff --git a/schema/v1/schema.unstable.json b/schema/v1/schema.unstable.json index 4888492e0..54be68f6c 100644 --- a/schema/v1/schema.unstable.json +++ b/schema/v1/schema.unstable.json @@ -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" } @@ -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"