Notifications

Notifications

The modeled state of a session’s harness notification-delivery queue.

Usage

Source

Notifications(
    queued,
    delivered,
    enqueued,
)

Reconstructed by replaying the transcript’s queue-operation audit records in order: each enqueue appends its content to a FIFO, each dequeue/remove drops the head, and each popAll subtracts every queued item whose text is contained in the operation’s content — a queued user command drains without taking an unrelated notification with it.

Attributes

queued: tuple[str, …]

The enqueue contents still in the modeled FIFO, undelivered.

delivered: tuple[str, …]

The notification texts that actually reached the agent — user turns carrying a <task-notification> plus every queued command replayed to the model.

enqueued: tuple[str, …]
Every enqueue content ever observed, in order.

Example

>>> session.notifications.completed("toolu_01XVXcp6yKvn2xbmPxdf1a3z")

True

Attributes

Name Description
has_pending Whether any queued item is an undelivered task notification.
has_pending

Whether any queued item is an undelivered task notification.

has_pending: bool

Methods

Name Description
completed() Whether the tool call’s notification has reached the agent.
from_events() Replays the notification queue over events, in order.
pending() Whether the tool call’s notification is still queued for delivery.
completed()

Whether the tool call’s notification has reached the agent.

Usage

Source

completed(tool_use_id)

True when the notification was delivered, or when it was enqueued at some point yet no longer sits undelivered in the queue.

from_events()

Replays the notification queue over events, in order.

Usage

Source

from_events(events)
pending()

Whether the tool call’s notification is still queued for delivery.

Usage

Source

pending(tool_use_id)