Files
codex/codex-rs/thread-store/src/realtime.rs
T
Zahan Malkani 05229d1874 Add snapshot pagination for persisted realtime history (#61480)
## What changed

Add experimental `thread/realtime/list` reads independent of turn pagination or a live runtime. Support session, observation-time, and event-ID filters, with ordering by observation time or committed position.

Keep cursor pagination within a fixed snapshot and expose positions for catching up on events committed later. Return `unsupported`, `pending`, or `ready` coverage so clients can distinguish unavailable history from events awaiting indexing. Limit fork reads to the child's own realtime history.

## Testing

Add SQLite tests for snapshot stability, late-event catch-up, cursor validation, and coverage tracking. Extend app-server tests to cover filtering, exact event lookup, and fork isolation.

GitOrigin-RevId: 8158df53f10d948ede4911654aa8adbc7297b258
2026-11-14 07:09:26 +00:00

24 lines
784 B
Rust

//! Shared query contract for the independent, immutable realtime history stream.
use codex_app_server_protocol::ThreadRealtimeOrder;
use codex_protocol::ThreadId;
use serde::Deserialize;
use serde::Serialize;
pub use codex_app_server_protocol::ThreadRealtimeListResponse as RealtimePage;
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct ListRealtimeParams {
pub thread_id: ThreadId,
pub session_id: Option<String>,
pub from_observed_at_ms: Option<i64>,
pub to_observed_at_ms: Option<i64>,
pub order: ThreadRealtimeOrder,
pub after_position: Option<u64>,
pub event_id: Option<String>,
pub cursor: Option<String>,
pub page_size: usize,
pub snapshot_end: Option<u64>,
pub required_through_position: Option<u64>,
}