mirror of
https://github.com/openai/codex.git
synced 2026-11-11 21:10:39 +00:00
core: document compaction tail merge race
Explain the snapshot-to-replace race at both compaction call sites so the extra re-snapshot and append-only tail preservation logic is easier to review. Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
co-authored by
Codex
parent
1023dee640
commit
8335832f1c
@@ -211,6 +211,9 @@ async fn run_compact_task_inner(
|
||||
.cloned()
|
||||
.collect();
|
||||
new_history.extend(ghost_snapshots);
|
||||
// Compaction snapshots history, waits on a model call, then replaces
|
||||
// session history wholesale. Background writers can append during that
|
||||
// window, so re-snapshot here and preserve any append-only tail items.
|
||||
let latest_history_snapshot = sess.clone_history().await;
|
||||
if !append_concurrent_history_tail_if_append_only(
|
||||
&mut new_history,
|
||||
|
||||
@@ -151,6 +151,9 @@ async fn run_remote_compact_task_inner_impl(
|
||||
if !ghost_snapshots.is_empty() {
|
||||
new_history.extend(ghost_snapshots);
|
||||
}
|
||||
// Remote compaction snapshots history, waits on an API call, then replaces
|
||||
// session history wholesale. Background writers can append during that
|
||||
// window, so re-snapshot here and preserve any append-only tail items.
|
||||
let latest_history_snapshot = sess.clone_history().await;
|
||||
if !append_concurrent_history_tail_if_append_only(
|
||||
&mut new_history,
|
||||
|
||||
Reference in New Issue
Block a user