mirror of
https://github.com/openai/codex.git
synced 2026-10-20 17:38:45 +00:00
[thread-store] separate history materialization
This commit is contained in:
@@ -168,6 +168,14 @@ pub(super) async fn append_items(
|
||||
pub(super) async fn persist_thread(
|
||||
store: &LocalThreadStore,
|
||||
thread_id: ThreadId,
|
||||
) -> ThreadStoreResult<()> {
|
||||
persist_history(store, thread_id).await?;
|
||||
store.flush_pending_metadata_update(thread_id).await
|
||||
}
|
||||
|
||||
pub(super) async fn persist_history(
|
||||
store: &LocalThreadStore,
|
||||
thread_id: ThreadId,
|
||||
) -> ThreadStoreResult<()> {
|
||||
store
|
||||
.live_recorder(thread_id)
|
||||
@@ -175,8 +183,7 @@ pub(super) async fn persist_thread(
|
||||
.persist()
|
||||
.await
|
||||
.map_err(thread_store_io_error)?;
|
||||
sync_materialized_rollout_path(store, thread_id).await?;
|
||||
store.flush_pending_metadata_update(thread_id).await
|
||||
sync_materialized_rollout_path(store, thread_id).await
|
||||
}
|
||||
|
||||
pub(super) async fn flush_thread(
|
||||
|
||||
@@ -83,7 +83,7 @@ pub(super) async fn update_thread_metadata(
|
||||
}
|
||||
|
||||
if live_writer::rollout_path(store, thread_id).await.is_ok() {
|
||||
live_writer::persist_thread(store, thread_id).await?;
|
||||
live_writer::persist_history(store, thread_id).await?;
|
||||
}
|
||||
let mut resolved_rollout_path =
|
||||
resolve_rollout_path(store, thread_id, params.include_archived).await?;
|
||||
|
||||
Reference in New Issue
Block a user