preserve legacy rollout lookup behavior

This commit is contained in:
anais
2026-06-15 13:48:54 -07:00
parent 0a1bb6927d
commit 181d8b175a
2 changed files with 5 additions and 2 deletions

View File

@@ -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(

View File

@@ -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() {