get_messages_to_prune(
self,
count: int | None = None,
) -> list[MessageData]| Name | Type | Description |
|---|---|---|
count | int | None | Default: NoneNumber of messages to prune, or None to prune enough to get back to WINDOW_SIZE. |
Get the oldest visible messages that should be pruned.
Returns a contiguous run of messages from the START of the visible window. Stops at the first protected message (the active stream or a live tool run) to avoid creating gaps in the visible window (which would desync store state from the DOM).