Skip to content

Resolve paginated thread history by rollout ID - #38244

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/1101e548a6e6c6d319996e24cb650e5b03ab7fbb
Aug 12, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/1101e548a6e6c6d319996e24cb650e5b03ab7fbb

Conversation

@copyberry

@copyberry copyberry Bot commented Aug 12, 2026 •

Copy link
Copy Markdown

Resolve paginated thread history by rollout ID

Why

thread/revert keeps the logical thread ID while selecting a new immutable
rollout. Using the thread ID for persisted history can therefore read or update
the wrong rollout.

What changed

  • Centralize resolution of a thread's current rollout across live writers,
    SQLite metadata, and filesystem fallbacks.
  • Key history materialization, lineage traversal, paging, turn lookup, and fork
    boundaries by immutable rollout ID while retaining the thread ID for the
    logical thread.
  • Treat SQLite's selected rollout as authoritative for paginated threads so a
    filesystem scan cannot select an older rollout after thread/revert.

Testing

Add a regression test showing that update-ordinal item paging reads from the
selected rollout ID when it differs from the thread ID.

## Why

`thread/revert` keeps the logical thread ID while selecting a new immutable
rollout. Using the thread ID for persisted history can therefore read or update
the wrong rollout.

## What changed

- Centralize resolution of a thread's current rollout across live writers,
  SQLite metadata, and filesystem fallbacks.
- Key history materialization, lineage traversal, paging, turn lookup, and fork
  boundaries by immutable rollout ID while retaining the thread ID for the
  logical thread.
- Treat SQLite's selected rollout as authoritative for paginated threads so a
  filesystem scan cannot select an older rollout after `thread/revert`.

## Testing

Add a regression test showing that update-ordinal item paging reads from the
selected rollout ID when it differs from the thread ID.

GitOrigin-RevId: 1101e548a6e6c6d319996e24cb650e5b03ab7fbb
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/1101e548a6e6c6d319996e24cb650e5b03ab7fbb branch from bf4978d to 8d4d573 Compare August 12, 2026 20:33
@copyberry
copyberry Bot merged commit 8d4d573 into main Aug 12, 2026
28 of 32 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/1101e548a6e6c6d319996e24cb650e5b03ab7fbb branch August 12, 2026 20:34
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 12, 2026
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.

1 participant