Skip to content

CancelNotification

Base classes

Name Children Inherits
AnnotatedObject
aclientp.schema.base
Base class for generated models.

⋔ Inheritance diagram

graph TD
  95970860254400["notifications.CancelNotification"]
  95970862258240["base.AnnotatedObject"]
  95970862254416["base.Schema"]
  95970851503232["main.BaseModel"]
  125067848591872["builtins.object"]
  95970862258240 --> 95970860254400
  95970862254416 --> 95970862258240
  95970851503232 --> 95970862254416
  125067848591872 --> 95970851503232

🛈 DocStrings

Bases: AnnotatedObject

Notification to cancel ongoing operations for a session.

This is a notification sent by the client to cancel an ongoing prompt turn.

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 StopReason::Cancelled

See protocol docs: Cancellation

Source code in src/aclientp/schema/notifications.py
class CancelNotification(AnnotatedObject):
    """Notification to cancel ongoing operations for a session.

    This is a notification sent by the client to cancel an ongoing prompt turn.

    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 `StopReason::Cancelled`

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

    session_id: str
    """The ID of the session to cancel operations for."""

session_id instance-attribute

session_id: str

The ID of the session to cancel operations for.

:fa-brands-github: Show source on GitHub