mirror of
https://github.com/openai/codex.git
synced 2026-11-06 20:20:34 +00:00
## Why Thread history JSONL is the durable source of truth, while SQLite is a rebuildable view. If a SQLite projection fails after a durable append, the next write must catch up the unprojected suffix instead of skipping it. ## What changed - Start materialization at the byte offset stored in `thread_history_projection_state`. - Project only complete newline-terminated rollout records, leaving a trailing partial record for a later pass. - Preserve validation for missing files, invalid offsets, and missing or out-of-order ordinals without advancing projection state. ## Testing Add coverage for catching up after projection failure, avoiding replay when already synchronized, retaining partial lines, and rejecting invalid suffixes without changing SQLite state. GitOrigin-RevId: 8a7200a77edd5411ddf5fe31ab6af5ee287ed7d7