mirror of
https://github.com/openai/codex.git
synced 2026-11-17 06:57:31 +00:00
Protect fork history references during rollout cleanup (#34566)
## Why Paginated forks can retain a `history_base` pointer to another rollout. Deleting or compressing either side of that relationship can leave the fork without the rollout history it references. ## What changed - Add a rollout reference index that scans active, archived, and compressed rollout metadata. - Reject deletion when a rollout is still referenced by a fork outside the requested deletion set. - Delete spawned thread subtrees as one store operation so internal references do not block deleting the complete subtree, while external references preflight the request before any files are removed. - Skip referenced rollouts, fork-pointer rollouts, and rollouts with unreadable metadata during background compression. ## Testing - Cover reference indexing across active, archived, compressed, duplicate, and self-referencing rollouts. - Verify deletion rejects external references without partially deleting a subtree and permits batch deletion of internally referenced threads. - Verify compression preserves fork pointer chains and continues past unreadable metadata. GitOrigin-RevId: a8672727f8706e743d7fb3ca895a1d9ceac98a3c
This commit is contained in:
1 parent
7bb13ab846
commit
0b175e6439
13 files changed
+801
-21
No files matched your search
@@ -14,6 +14,7 @@ mod persistence_metrics;
|
||||
pub(crate) mod policy;
|
||||
pub(crate) mod recorder;
|
||||
mod reverse_jsonl_scanner;
|
||||
mod rollout_reference_index;
|
||||
pub(crate) mod search;
|
||||
pub(crate) mod session_index;
|
||||
mod sqlite_metrics;
|
||||
@@ -73,6 +74,7 @@ pub use recorder::RolloutRecorderParams;
|
||||
pub use recorder::append_rollout_item_to_path;
|
||||
pub use reverse_jsonl_scanner::ReverseJsonlScanner;
|
||||
pub use reverse_jsonl_scanner::ScanOutcome;
|
||||
pub use rollout_reference_index::RolloutReferenceIndex;
|
||||
pub use search::first_rollout_content_match_snippet;
|
||||
pub use search::search_rollout_matches;
|
||||
pub use search::search_rollout_paths;
|
||||
|
||||
Reference in new issue
Block a user