mirror of
https://github.com/openai/codex.git
synced 2026-09-13 11:47:17 +00:00
preserve legacy rollout lookup behavior
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user