document projection persistence follow-ups

This commit is contained in:
Tom Wiltzius
2026-06-04 21:53:43 -07:00
parent ca445e0899
commit 41b2533e76
3 changed files with 8 additions and 0 deletions
@@ -24,6 +24,10 @@ mod tests;
///
/// Persisting it lets the next append reuse stable item ordinals and update non-terminal
/// ThreadItems without replaying the full rollout history first.
///
/// TODO(wiltzius): Before stores persist or restore this checkpoint, include enough reducer state
/// to resume reasoning coalescing, complete open items from any turn, and tombstone rolled-back
/// closed items after restart.
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct ThreadItemProjectionCheckpoint {
pub next_thread_item_ordinal: i64,
+2
View File
@@ -601,6 +601,8 @@ impl Session {
Box::new(codex_app_server_protocol::TurnSummaryProjectionObserver::new()),
Box::new(codex_app_server_protocol::LifecycleProjectionObserver::new()),
];
// TODO(wiltzius): Once stores persist projections, restore each observer from the
// stored projection checkpoint on resume instead of always starting fresh.
Ok(Some(live_thread.with_thread_history_projection_observers(
thread_history_projection_observers,
)))
+2
View File
@@ -145,6 +145,8 @@ impl LiveThread {
pub async fn append_items(&self, items: &[RolloutItem]) -> ThreadStoreResult<()> {
let canonical_items = persisted_rollout_items(items);
// TODO(wiltzius): Once stores persist thread-history mutations, advance observer state
// only when the canonical append and derived mutations commit successfully together.
let thread_history_mutations = self
.thread_history_projection_observers
.lock()