Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions codex-rs/rollout/src/compression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,14 @@ mod worker {
let result = async {
cleanup_stale_temps(codex_home.as_path()).await?;
let mut stats = CompressionStats::default();
if started_at.elapsed() < WORKER_MAX_RUNTIME {
let archived_root = codex_home.join(ARCHIVED_SESSIONS_SUBDIR);
compress_rollouts_in_root(archived_root.as_path(), started_at, &mut stats).await?;
for root in [
codex_home.join(ARCHIVED_SESSIONS_SUBDIR),
codex_home.join(SESSIONS_SUBDIR),
Comment thread
jif-oai marked this conversation as resolved.
] {
if started_at.elapsed() >= WORKER_MAX_RUNTIME {
break;
}
compress_rollouts_in_root(root.as_path(), started_at, &mut stats).await?;
}
Ok::<_, io::Error>(stats)
}
Expand Down
6 changes: 3 additions & 3 deletions codex-rs/rollout/src/compression_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ async fn search_rollout_matches_uses_logical_path_for_compressed_rollout() -> an
}

#[tokio::test]
async fn worker_compresses_old_archived_rollouts_only() -> anyhow::Result<()> {
async fn worker_compresses_old_active_and_archived_rollouts() -> anyhow::Result<()> {
let home = TempDir::new()?;
let active_uuid = Uuid::from_u128(3);
let active_id = ThreadId::from_string(&active_uuid.to_string())?;
Expand Down Expand Up @@ -158,8 +158,8 @@ async fn worker_compresses_old_archived_rollouts_only() -> anyhow::Result<()> {

worker::run(home.path().to_path_buf()).await?;

assert!(active_path.exists());
assert!(!compressed_rollout_path(&active_path).exists());
assert!(!active_path.exists());
assert!(compressed_rollout_path(&active_path).exists());
assert!(!archived_path.exists());
assert!(compressed_rollout_path(&archived_path).exists());
assert!(fresh_path.exists());
Expand Down
Loading