From 181d8b175a83aa70de681cd4ba71e128da8e2f84 Mon Sep 17 00:00:00 2001 From: anais Date: Mon, 15 Jun 2026 13:48:54 -0700 Subject: [PATCH] preserve legacy rollout lookup behavior --- codex-rs/rollout/src/list.rs | 4 +++- codex-rs/thread-store/src/local/read_thread.rs | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/codex-rs/rollout/src/list.rs b/codex-rs/rollout/src/list.rs index bf6ac7f264..b48f6ef2e5 100644 --- a/codex-rs/rollout/src/list.rs +++ b/codex-rs/rollout/src/list.rs @@ -1779,6 +1779,7 @@ async fn find_thread_path_by_id_str_in_subdir( }; let thread_id = ThreadId::from_string(id_str).ok(); let mut state_metadata_path = None; + let mut unverified_db_path = None; let mut fallback_reason = state_db_ctx.is_none().then_some("db_unavailable"); if let Some(state_db_ctx) = state_db_ctx && let Some(thread_id) = thread_id @@ -1829,6 +1830,7 @@ async fn find_thread_path_by_id_str_in_subdir( "state db returned rollout path for thread {id_str} that could not be verified: {}: {err}", existing_db_path.display() ); + unverified_db_path = Some(existing_db_path); fallback_reason = Some("unverified_path"); } } @@ -1899,7 +1901,7 @@ async fn find_thread_path_by_id_str_in_subdir( } } - Ok(found) + Ok(found.or(unverified_db_path)) } async fn find_thread_path_by_id_str_in_any_subdir( diff --git a/codex-rs/thread-store/src/local/read_thread.rs b/codex-rs/thread-store/src/local/read_thread.rs index 851dac3b1b..02cd4413e5 100644 --- a/codex-rs/thread-store/src/local/read_thread.rs +++ b/codex-rs/thread-store/src/local/read_thread.rs @@ -49,7 +49,8 @@ pub(super) async fn read_thread( .await; let mut thread = stored_thread_from_sqlite_metadata(store, metadata).await; if !params.include_history || rollout_thread.is_some() { - if let Some(mut rollout_thread) = rollout_thread + if !params.include_history + && let Some(mut rollout_thread) = rollout_thread && !rollout_thread.preview.is_empty() { if thread.name.is_some() {