From 11ae82e47596d93580824e0977ba05ec12b5cd91 Mon Sep 17 00:00:00 2001 From: Friel Date: Fri, 19 Jun 2026 15:56:42 +0000 Subject: [PATCH] Preserve unmaterialized thread history errors --- codex-rs/thread-store/src/local/read_thread.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/codex-rs/thread-store/src/local/read_thread.rs b/codex-rs/thread-store/src/local/read_thread.rs index 1d63344022..8a662b7945 100644 --- a/codex-rs/thread-store/src/local/read_thread.rs +++ b/codex-rs/thread-store/src/local/read_thread.rs @@ -334,7 +334,15 @@ pub(super) async fn load_history_from_rollout_path( ) -> ThreadStoreResult { #[cfg(test)] read_work::record_history_read(); - let (items, thread_id, _) = RolloutRecorder::load_rollout_items(path) + let Some(path) = codex_rollout::existing_rollout_path(path).await else { + return Err(ThreadStoreError::InvalidRequest { + message: format!( + "failed to resolve rollout path `{}`: file does not exist", + path.display() + ), + }); + }; + let (items, thread_id, _) = RolloutRecorder::load_rollout_items(path.as_path()) .await .map_err(|err| ThreadStoreError::Internal { message: format!("failed to load thread history {}: {err}", path.display()),