[codex] Move persistence policy application into ThreadStore (#27318)

Move the application of the persistence policy into the thread store, so
thread stores can get raw append items rather than canonical append
items. This will enable store-specific projections over the raw input
items.
This commit is contained in:
Tom
2026-06-11 16:24:12 -07:00
committed by GitHub
parent eddc5c75ed
commit b2cc01fc7c
8 changed files with 91 additions and 54 deletions
+3 -4
View File
@@ -36,11 +36,10 @@ pub trait ThreadStore: Any + Send + Sync {
/// Reopens an existing thread for live appends.
async fn resume_thread(&self, params: ResumeThreadParams) -> ThreadStoreResult<()>;
/// Appends canonical rollout items to a live thread.
/// Appends raw rollout items to a live thread.
///
/// This is the raw history API. It does not infer metadata from item contents. Callers that
/// need metadata updates should call [`ThreadStore::update_thread_metadata`] with explicit
/// metadata facts prepared above the store.
/// Implementations should apply the shared rollout persistence policy before writing durable
/// replay history and before updating any implementation-owned projections.
async fn append_items(&self, params: AppendThreadItemsParams) -> ThreadStoreResult<()>;
/// Materializes the thread if persistence is lazy, then persists all queued items.