fix resume response metadata source

This commit is contained in:
anais
2026-06-23 11:39:51 -07:00
parent 38389d9d9e
commit de5a035705

View File

@@ -3337,7 +3337,14 @@ impl ThreadRequestProcessor {
.await?;
ResumeHistoryExtent::Full
};
let mut response_thread = stored_thread.clone();
let mut response_thread = self
.read_stored_thread_for_resume(thread_id, path, /*include_history*/ false)
.await
.ok()
.filter(|response_thread| {
stored_threads_have_same_resume_source(response_thread, &stored_thread)
})
.unwrap_or_else(|| stored_thread.clone());
response_thread.history = None;
let history = self.take_stored_thread_initial_history(&mut stored_thread)?;
Ok((history, response_thread, history_extent))
@@ -4988,6 +4995,13 @@ fn set_thread_name_from_title(thread: &mut Thread, title: String) {
thread.name = Some(title);
}
fn stored_threads_have_same_resume_source(
candidate: &StoredThread,
verified: &StoredThread,
) -> bool {
candidate.thread_id == verified.thread_id && candidate.rollout_path == verified.rollout_path
}
pub(crate) fn thread_from_stored_thread(
thread: StoredThread,
fallback_provider: &str,