diff --git a/codex-rs/app-server-protocol/src/protocol/thread_item_projection.rs b/codex-rs/app-server-protocol/src/protocol/thread_item_projection.rs index 813c927a05..845689a948 100644 --- a/codex-rs/app-server-protocol/src/protocol/thread_item_projection.rs +++ b/codex-rs/app-server-protocol/src/protocol/thread_item_projection.rs @@ -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, diff --git a/codex-rs/core/src/session/session.rs b/codex-rs/core/src/session/session.rs index 6d5c90a291..a44f626c8c 100644 --- a/codex-rs/core/src/session/session.rs +++ b/codex-rs/core/src/session/session.rs @@ -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, ))) diff --git a/codex-rs/thread-store/src/live_thread.rs b/codex-rs/thread-store/src/live_thread.rs index 5d24abe426..c3e4d4f8fb 100644 --- a/codex-rs/thread-store/src/live_thread.rs +++ b/codex-rs/thread-store/src/live_thread.rs @@ -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()