From e7ddb311daed3b9cda507b7ac42abe35f7f3e9e9 Mon Sep 17 00:00:00 2001 From: Owen Lin Date: Fri, 30 Jan 2026 15:48:56 -0800 Subject: [PATCH] fix test --- codex-rs/core/src/rollout/truncation.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codex-rs/core/src/rollout/truncation.rs b/codex-rs/core/src/rollout/truncation.rs index 500d5e1695..6ee9833562 100644 --- a/codex-rs/core/src/rollout/truncation.rs +++ b/codex-rs/core/src/rollout/truncation.rs @@ -191,7 +191,7 @@ pub(crate) fn truncate_rollout_drop_last_n_user_turns( let n_from_end = usize::try_from(num_turns).unwrap_or(usize::MAX); if n_from_end >= user_turns.len() { - let Some(first_user_idx) = user_message_positions_in_rollout(items).first().copied() else { + let Some(first_user_idx) = user_turns.first().map(|turn| turn.source_index) else { return items.to_vec(); }; return items[..first_user_idx].to_vec();