codex: clarify compacted replacement history sync

Add an inline comment explaining why replacement_history is refreshed
from the final in-memory items after the ghost snapshot tail merge.

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Charles Cunningham
2026-03-16 12:52:40 -07:00
parent dd53b7e1b5
commit 232ffcffc6

View File

@@ -3381,6 +3381,9 @@ impl Session {
);
state.replace_history(items.clone(), reference_context_item.clone());
}
// `items` may have gained a concurrent ghost snapshot tail under the
// state lock, so refresh the persisted replacement history to match the
// in-memory install.
compacted_item.replacement_history = Some(items);
self.persist_rollout_items(&[RolloutItem::Compacted(compacted_item)])