mirror of
https://github.com/openai/codex.git
synced 2026-11-25 23:30:49 +00:00
document projection persistence follow-ups
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
)))
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user