Skip to content

Resume thread history projection from its SQLite checkpoint - #32928

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/8a7200a77edd5411ddf5fe31ab6af5ee287ed7d7
Jul 14, 2026
Merged

Resume thread history projection from its SQLite checkpoint#32928
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/8a7200a77edd5411ddf5fe31ab6af5ee287ed7d7

Conversation

@copyberry

@copyberry copyberry Bot commented Jul 14, 2026

Copy link
Copy Markdown

Resume thread history projection from its SQLite checkpoint

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.

## 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
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/8a7200a77edd5411ddf5fe31ab6af5ee287ed7d7 branch from 96a8dc5 to b24aa20 Compare July 14, 2026 02:24
@copyberry
copyberry Bot merged commit b24aa20 into main Jul 14, 2026
14 of 32 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/8a7200a77edd5411ddf5fe31ab6af5ee287ed7d7 branch July 14, 2026 02:25
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 14, 2026
@Wars
Wars temporarily deployed to issue-triage July 14, 2026 02:54 — with GitHub Actions Inactive
@Wars
Wars temporarily deployed to issue-triage July 14, 2026 02:54 — with GitHub Actions Inactive
@Wars
Wars temporarily deployed to issue-triage July 14, 2026 02:54 — with GitHub Actions Inactive
@Wars
Wars temporarily deployed to issue-triage July 14, 2026 02:55 — with GitHub Actions Inactive
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.