Skip to content

Commit d037bd0

Browse files
committed
Improve cancellation section
1 parent f3df285 commit d037bd0

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

docs/protocol/prompt-turn.mdx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,10 @@ Clients **MAY** cancel an ongoing prompt turn at any time by sending a `session/
227227
}
228228
```
229229

230+
The Client **SHOULD** preemptively mark all non-finished tool calls pertaining to the current turn as `cancelled` as soon as it sends the `session/cancel` notification.
231+
232+
The Client **MUST** respond to all pending `session/request_permission` requests with the `cancelled` outcome.
233+
230234
When the Agent receives this notification, it **SHOULD** stop all language model requests and all tool call invocations as soon as possible.
231235

232236
After all ongoing operations have been successfully aborted, the Agent **MUST** respond to the original `session/prompt` request with the `cancelled` [stop reason](#stop-reasons).
@@ -241,9 +245,7 @@ After all ongoing operations have been successfully aborted, the Agent **MUST**
241245

242246
The Agent **MAY** send `session/update` notifications with content or tool call updates after receiving the `session/cancel` notification, but it **MUST** ensure that it does so before responding to the `session/prompt` request.
243247

244-
The Client **SHOULD** preemptively mark all non-finished tool calls pertaining to the current turn as `cancelled` as soon as it sends the `session/cancel` notification, since the Agent is not required to do so.
245-
246-
The Client **SHOULD** still accept tool call updates received after sending `session/cancel` to prevent dropping valuable information.
248+
The Client **SHOULD** still accept tool call updates received after sending `session/cancel`.
247249

248250
---
249251

0 commit comments

Comments
 (0)