mirror of
https://github.com/openai/codex.git
synced 2026-11-16 06:54:36 +00:00
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
This commit is contained in:
1 parent
4496ba3fd5
commit
ed390a5dc4
1 file changed
+3
-3
@@ -7,7 +7,7 @@ use codex_rollout::RolloutConfig;
|
|||||||
use codex_rollout::RolloutItem;
|
use codex_rollout::RolloutItem;
|
||||||
use codex_rollout::RolloutRecorder;
|
use codex_rollout::RolloutRecorder;
|
||||||
use codex_rollout::RolloutRecorderParams;
|
use codex_rollout::RolloutRecorderParams;
|
||||||
use codex_rollout::persisted_rollout_items;
|
use codex_rollout::is_persisted_rollout_item;
|
||||||
use tracing::warn;
|
use tracing::warn;
|
||||||
|
|
||||||
use super::LocalThreadStore;
|
use super::LocalThreadStore;
|
||||||
@@ -289,8 +289,8 @@ async fn write_and_project(
|
|||||||
let (recorder, history_mode) = live_writer_parts(store, thread_id).await?;
|
let (recorder, history_mode) = live_writer_parts(store, thread_id).await?;
|
||||||
let sync_rollout_path = matches!(&write_op, RolloutWriteOp::Persist | RolloutWriteOp::Flush);
|
let sync_rollout_path = matches!(&write_op, RolloutWriteOp::Persist | RolloutWriteOp::Flush);
|
||||||
let write_op = match write_op {
|
let write_op = match write_op {
|
||||||
RolloutWriteOp::AppendItems(items) => {
|
RolloutWriteOp::AppendItems(mut items) => {
|
||||||
let items = persisted_rollout_items(items.as_slice(), history_mode);
|
items.retain(|item| is_persisted_rollout_item(item, history_mode));
|
||||||
if items.is_empty() {
|
if items.is_empty() {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user