<#7666 fix(runs): honor Offset in ListActions so W...
# flyte-github
a
#7666 fix(runs): honor Offset in ListActions so WatchActions returns all actions Pull request opened by pingsutw on <!date^1784001931^{date_short}|2026-07-14T04:05:31Z> Problem
WatchActions
only ever returns ~100 actions for a run, even when the run has many more (e.g. 1,000). Observed on a run with 1,000 actions — the client/console only sees the first ~100. Root cause
ListResourceInput
supports two mutually-exclusive pagination modes: keyset (
CursorToken
) and
Offset
.
actionRepo.ListActions
implements only the cursor path — it builds
... LIMIT ?
and never emits an
OFFSET
, so the
Offset
field is silently ignored. `WatchActions`' initial full listing (
listAndSendAllActions
) paginates by
Offset
(
offset += pageSize
). Because
ListActions
ignored it, every page re-read the same first
~Limit
rows, so only the first page was ever delivered. Fix Emit
OFFSET ?
when
input.Offset > 0
. Cursor-based callers (the
ListActions
RPC handlers) pass
Offset == 0
and are unchanged; only the offset-based
WatchActions
initial listing is affected. queryBuilder.WriteString(" LIMIT ?") args = append(args, input.Limit+1) if input.Offset > 0 { queryBuilder.WriteString(" OFFSET ?") args = append(args, input.Offset) } Test
TestListActions_OffsetPagination
— creates 5 root actions and asserts
offset=N
returns
total-N
rows (order-independent counts). These assertions fail on the old behavior (offset ignored → every page returned all 5). Existing
TestListRuns
(cursor pagination) still passes, confirming the change is additive.
Copy code
ok  github.com/flyteorg/flyte/v2/runs/repository/impl  12.176s
https://claude.ai/code/session_01AjhEAjx4yGQY9MhpY5DEXd flyteorg/flyte