Skip to content

Fix pagination for unindexed threads sorted by ascending recency - #61181

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/09354055b6e60666a493d9411ed3eb9778b73c0a
Nov 12, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/09354055b6e60666a493d9411ed3eb9778b73c0a

Conversation

@copyberry

@copyberry copyberry Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Fix pagination for unindexed threads sorted by ascending recency

Why

Listing threads by ascending recency_at can omit next_cursor when rollout files have not yet been indexed in SQLite, preventing clients from fetching the remaining threads.

What changed

Scan and index one extra rollout for ascending recency listings when SQLite is available, so the database can detect another page. Trim filesystem results to the requested page size for this sort order.

Testing

Add a regression test that creates two unindexed rollouts after startup backfill and lists them with a provider filter and a page size of one. Verify both threads are returned in order, with a cursor only on the first page.

)

## Why

Listing threads by ascending `recency_at` can omit `next_cursor` when rollout files have not yet been indexed in SQLite, preventing clients from fetching the remaining threads.

## What changed

Scan and index one extra rollout for ascending recency listings when SQLite is available, so the database can detect another page. Trim filesystem results to the requested page size for this sort order.

## Testing

Add a regression test that creates two unindexed rollouts after startup backfill and lists them with a provider filter and a page size of one. Verify both threads are returned in order, with a cursor only on the first page.

GitOrigin-RevId: 09354055b6e60666a493d9411ed3eb9778b73c0a
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/09354055b6e60666a493d9411ed3eb9778b73c0a branch from 9ce425c to bbd0d2b Compare November 12, 2026 21:03
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor
Codex Review Summary: 🔄 Running

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-11-12T21:03:39.951676Z 9ce425c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@copyberry
copyberry Bot merged commit bbd0d2b into main Nov 12, 2026
7 of 23 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/09354055b6e60666a493d9411ed3eb9778b73c0a branch November 12, 2026 21:03
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 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