pub fn snap_split_forward(
messages: &[Message],
split_idx: usize,
) -> Option<usize>Expand description
Snap split_idx forward until the kept prefix no longer ends mid tool-run
and the tail does not begin on a Tool role.
Returns None when snapping would keep nothing (entire list unsafe/consumed).
split_idx == messages.len() is always safe (drop whole list / keep only system via
apply_range).