You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5ee6389
Browse filesBrowse the repository at this point in the historyBrowse files
fix(webapp): use composite keyset cursor for run pagination
listRunIds/listRuns order by the composite key (created_at, run_id) but
the cursor predicate cut on run_id alone. That is only sound when run_id
lexicographic order matches created_at order. When a burst of runs is
created such that the two diverge, keyset pagination both re-includes
already-returned runs (duplicates) and drops runs it should return
(skips). For bulk replay this produced duplicate runs; for the dashboard
and runs.list it could silently skip or repeat runs at page boundaries.
- Cursors now encode the composite (created_at, run_id) key as an opaque
URL-safe base64 token and cut on the matching tuple predicate. The
ORDER BY is unchanged, so the table's primary-key alignment (and query
performance) is preserved.
- Cursors are server-issued opaque tokens (the SDK echoes
pagination.next/previous back), so this needs no client update. Legacy
bare-run_id cursors decode to the old run_id-only predicate for
backwards compatibility with in-flight cursors.
- listRunIds is the single cursor-aware list primitive, returning
{ runIds, pagination: { nextCursor, previousCursor } }; listRuns and
bulk actions build on it. Bulk actions finish when nextCursor is null.
- getTaskRunsQueryBuilder selects created_at; the pending-version lookup
keeps its run_id-only schema.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fix run pagination that could duplicate or skip runs: the query orders by `(created_at, run_id)` but the cursor cut on `run_id` alone, which diverges when run_id order doesn't match created_at order (e.g. bulk replay re-processing runs). Cursors now encode the composite key as an opaque token and cut on the matching tuple; legacy bare-run_id cursors stay supported for in-flight pagination.
0 commit comments