From ed390a5dc4b5e859ca7411ea5a81cd96470fb748 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Tue, 11 Aug 2026 16:10:16 +0000 Subject: [PATCH] Filter live rollout items in place (#38034) ## What changed Retain persistable items directly in the owned append buffer instead of cloning them into a second vector. Preserve the existing history-mode filtering and empty-append behavior. GitOrigin-RevId: 5300312545492bef28f63521427048a27d46a9d1 --- codex-rs/thread-store/src/local/live_writer.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/codex-rs/thread-store/src/local/live_writer.rs b/codex-rs/thread-store/src/local/live_writer.rs index 769a58ea03..a71ec86729 100644 --- a/codex-rs/thread-store/src/local/live_writer.rs +++ b/codex-rs/thread-store/src/local/live_writer.rs @@ -7,7 +7,7 @@ use codex_rollout::RolloutConfig; use codex_rollout::RolloutItem; use codex_rollout::RolloutRecorder; use codex_rollout::RolloutRecorderParams; -use codex_rollout::persisted_rollout_items; +use codex_rollout::is_persisted_rollout_item; use tracing::warn; use super::LocalThreadStore; @@ -289,8 +289,8 @@ async fn write_and_project( let (recorder, history_mode) = live_writer_parts(store, thread_id).await?; let sync_rollout_path = matches!(&write_op, RolloutWriteOp::Persist | RolloutWriteOp::Flush); let write_op = match write_op { - RolloutWriteOp::AppendItems(items) => { - let items = persisted_rollout_items(items.as_slice(), history_mode); + RolloutWriteOp::AppendItems(mut items) => { + items.retain(|item| is_persisted_rollout_item(item, history_mode)); if items.is_empty() { return Ok(()); }