Skip to content

Let users reprocess runs whose files have stalled - #224

Merged
wasimxyz merged 3 commits into
stagingfrom
cursor/reprocess-stalled-runs
Sep 4, 2026
Merged

Let users reprocess runs whose files have stalled#224
wasimxyz merged 3 commits into
stagingfrom
cursor/reprocess-stalled-runs

Conversation

@wasimxyz

@wasimxyz wasimxyz commented Sep 4, 2026

Copy link
Copy Markdown
Member

Summary

Runs whose files have stalled now offer Reprocess run in the row menu and the bulk action bar on the instrument runs table.

Changes

A file counts as stalled once it has sat in processing past the stall window (20 minutes by default), meaning the processor went away and it needs another attempt. Reprocessing a single stalled file already worked from the run detail page; the runs table had no equivalent for the whole run.

The server was already correct — POST /api/v1/instruments/:id/runs/:runId/reprocess queues every raw file that is uploaded, failed, completed, or stalled. Only the browser-side check disagreed: canReprocessRun counted the first three and left stalled out, so a run whose only unfinished file had stalled offered no retry, even though its status icon said the file "can be reprocessed".

reprocessableFileCount now sums the four states the endpoint queues, and canReprocessRun reads it. The confirmation dialog had been re-deriving that sum from three separate count props, which is how the two sides drifted apart; it takes one pre-summed eligibleFileCount instead, with wording updated to match. The dashboard runs table shares the same row-actions component and picks up the fix too.

Driveby changes

Separate commits, droppable.

  • The "Comments (N)" heading came from the server's initial fetch, so posting or deleting a comment left the number stale until the next refresh. It moved into RunCommentsList and now counts the list the page renders.
  • The instruments table printed every file pattern inline, widening rows. It now uses TruncatedBadges: first two visible, rest in a tooltip.

Testing

web/tests/unit/run-row-actions.test.ts covers the stalled case, each eligible state on its own, and the refusals: still inside the stall window, soft-deleted, and an instrument type with no processor. npm run test:unit (369 tests) and make check both pass.

By hand: on an instrument page, open the "…" menu of a run with a file stuck past the stall window — Reprocess run is there.

wasimxyz and others added 3 commits September 4, 2026 11:59
The run reprocess endpoint already queues raw files that are uploaded,
failed, completed, or stuck in `processing` past the stall window. The
runs table disagreed: `canReprocessRun` counted only the first three, so
a run whose only unfinished file had stalled offered no way to retry it
from the row menu or the bulk bar. The status tooltip on that same row
already said "can be reprocessed", which made the gap look like a bug.

Add `reprocessableFileCount` as the single place that sums the buckets
the endpoint would queue, and gate the row action on it. The
confirmation dialog was re-deriving the same sum from three separate
count props, which is how the two sides drifted apart, so it now takes
one pre-summed `eligibleFileCount` instead. Dialog copy updated to
match what it counts.

This also covers the dashboard runs table, which renders the same
`RunRowActions`.

Co-authored-by: Cursor <cursoragent@cursor.com>
The "Comments (N)" heading was rendered by the server component from the
initial fetch, so posting or deleting a comment updated the list but
left the count stale until the next refresh.

Move the heading into `RunCommentsList` and derive the count from the
optimistic array, so it tracks create and delete without a second piece
of state.

Co-authored-by: Cursor <cursoragent@cursor.com>
The column rendered every pattern inline, so instruments with many
patterns stretched the row. Reuse `TruncatedBadges`, which already caps
the visible count and puts the rest in a tooltip.

`TruncatedBadges` gains `variant` and `badgeClassName` pass-throughs so
the instruments table keeps its outline styling.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
data-hub Ready Ready Preview Sep 4, 2026 7:02pm UTC

Request Review

@wasimxyz wasimxyz self-assigned this Sep 4, 2026
@wasimxyz
wasimxyz merged commit 1a4a480 into staging Sep 4, 2026
4 checks passed
@wasimxyz
wasimxyz deleted the cursor/reprocess-stalled-runs branch September 4, 2026 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant