Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Filter live rollout items in place (#38034)

Tamir Dubersteined390a5dc4b5
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(());
}