Skip to content

Use the storage APIs for run detail views - #3944

Merged
karthikscale3 merged 3 commits into
mainfrom
kk/web-run-scoped-reads-from-storage
Sep 3, 2026
Merged

karthikscale3 merged 3 commits into
mainfrom
kk/web-run-scoped-reads-from-storage

Conversation

@karthikscale3

@karthikscale3 karthikscale3 commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

The run detail view was reading a run's events and step timeline from world.analytics while everything else on the page — the run itself, event payloads, individual steps, hooks, streams — came from the storage APIs. Mixing the two on one screen caused correctness problems, because the analytics namespace is a metadata mirror: it has a shorter retention window and is ingested asynchronously.

That showed up three ways:

  • Older runs rendered empty. Past the analytics retention window the trace and events tabs returned nothing, even though the run's data was still retained and readable.
  • Live runs showed gaps. While a run was still executing, its events could trail what had actually happened.
  • The page disagreed with itself. The events tab's id search reads a single event through storage, so it would happily find events the list above it wasn't showing.

All the run-scoped reads now go through the storage APIs, so the whole run detail view reads from one consistent source.

The runs list and hooks list stay on world.analytics. They span runs rather than sitting inside one, which is what that namespace is for.

Also here

  • The events tab's id search stops after fewer pages before reporting a truncated result, which suits the storage read path better.
  • Removes the fetchSteps server action and its /api/rpc method. The trace viewer has built its spans from events since the observability data-fetching refactor, which left fetchSteps the only /api/rpc method with no caller.

Notes for review

Only affects worlds that expose an analytics namespace. Local and Postgres worlds already read this way, so workflow web --localUi and local development are unchanged.

Backporting

Not for stable. 4.x has no analytics namespace, so packages/web there already reads the run detail view through the storage APIs — the bug this fixes cannot occur on that line.

fetchSteps is orphaned on stable too, so that half would technically apply, but removing an /api/rpc method is a behaviour change on a GA line rather than a stability fix, and not worth backporting on its own.

@vercel

vercel Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
example-nextjs-workflow-turbopack Ready Ready Preview, v0 Sep 3, 2026 7:18pm UTC
example-nextjs-workflow-webpack Ready Ready Preview, v0 Sep 3, 2026 7:18pm UTC
example-workflow Ready Ready Preview, v0 Sep 3, 2026 7:18pm UTC
workbench-astro-workflow Ready Ready Preview, v0 Sep 3, 2026 7:18pm UTC
workbench-express-workflow Ready Ready Preview, v0 Sep 3, 2026 7:18pm UTC
workbench-fastify-workflow Ready Ready Preview, v0 Sep 3, 2026 7:18pm UTC
workbench-hono-workflow Ready Ready Preview, v0 Sep 3, 2026 7:18pm UTC
workbench-nestjs-workflow Ready Ready Preview, v0 Sep 3, 2026 7:18pm UTC
workbench-nitro-workflow Ready Ready Preview, v0 Sep 3, 2026 7:18pm UTC
workbench-nuxt-workflow Ready Ready Preview, v0 Sep 3, 2026 7:18pm UTC
workbench-python-workflow Ready Ready Preview, v0 Sep 3, 2026 7:18pm UTC
workbench-sveltekit-workflow Ready Ready Preview, v0 Sep 3, 2026 7:18pm UTC
workbench-tanstack-start-workflow Ready Ready Preview, v0 Sep 3, 2026 7:18pm UTC
workbench-vite-workflow Ready Ready Preview, v0 Sep 3, 2026 7:18pm UTC
workflow-docs Ready Ready Preview, v0 Sep 3, 2026 7:18pm UTC
workflow-swc-playground Ready Ready Preview, v0 Sep 3, 2026 7:18pm UTC
workflow-tarballs Ready Ready Preview, v0 Sep 3, 2026 7:18pm UTC
workflow-web Ready Ready Preview, v0 Sep 3, 2026 7:18pm UTC

@changeset-bot

changeset-bot Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9e74929

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
Name Type
@workflow/web Patch
@workflow/cli Patch
@workflow/nitro Patch
workflow Patch
@workflow/world-testing Patch
@workflow/nuxt Patch
@workflow/core Patch
@workflow/web-shared Patch
@workflow/builders Patch
@workflow/next Patch
@workflow/vitest Patch
@workflow/astro Patch
@workflow/nest Patch
@workflow/rollup Patch
@workflow/sveltekit Patch
@workflow/vite Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

A run's events were read from a different source than the rest of the run
detail view, one with a shorter retention window and a small ingestion
delay. Past that window the trace and events tabs came up empty even
though the run's data was still retained, and the events tab's own id
search would find events the list above it was not showing. Inside the
window, a run still executing could show gaps.

All the run-scoped reads now come from the same source as the rest of the
view. The runs list and hooks list are unchanged: they span runs and are
fine where they are.

The events tab's id search now stops after fewer pages before reporting a
truncated result.

Removes the fetchSteps server action and its /api/rpc method. The trace
viewer has built its spans from events since the observability
data-fetching refactor, which left fetchSteps the only /api/rpc method
with no caller.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Sim World

Simulated world deterministic testing for races. Traces

🟠 world-sim scenario book — 1 fail of 41 total

fence=per-spec

scenario outcome events virt replay violations
✅ smoke-no-steps completed 3 0ms ok 0
✅ smoke-one-step completed 6 0ms ok 0
✅ hook-at-step-started completed 12 0ms ok 0
✅ hook-at-step-completed completed 12 0ms ok 0
✅ hook-at-hook-created completed 12 0ms ok 0
✅ deadline-hook-wins completed 7 1.0h ok 0
✅ deadline-expires completed 7 1.0h ok 0
✅ long-sleep completed 11 30.0d ok 0
✅ hook-never-arrives stalled 3 0ms skipped 0
✅ step-retries-twice completed 10 2.0s ok 0
✅ parallel-steps completed 9 0ms ok 0
✅ hook-on-execution-state completed 12 0ms ok 0
✅ peek-hook-before-branch completed 12 0ms ok 0
✅ peek-hook-after-branch completed 12 0ms ok 0
✅ peek-hook-at-registration completed 12 0ms ok 0
✅ race-hook-before-probe completed 12 0ms ok 0
✅ race-hook-after-probe completed 12 0ms ok 0
✅ race-duplicate-delivery completed 13 0ms ok 0
✅ attr-hook-before-step completed 11 0ms ok 0
✅ attr-hook-after-step completed 11 0ms ok 0
✅ attr-from-step-body completed 13 0ms ok 0
✅ fork-hook-after-timeout completed 14 1.0m ok 0
✅ fork-hook-before-timeout completed 14 1.0m ok 0
✅ count-hook-after-timeout completed 17 1.0m ok 0
✅ count-hook-before-timeout completed 20 1.0m ok 0
✅ stale-read-step-count-fork completed 20 1.0m ok 0
✅ stale-read-equal-step-counts completed 14 1.0m ok 0
✅ step-vs-step-fork completed 12 0ms ok 0
✅ step-vs-step-fork-fenced completed 12 0ms ok 0
✅ fence-catches-benign-direction completed 12 5ms ok 0
✅ in-flight-before-decision completed 17 1.0m ok 0
❌ in-flight-before-decision-counted completed 17 1.0m ok 0
✅ in-flight-after-decision completed 19 2.0m ok 0
✅ stale-read-step-count-fork-fenced completed 20 1.0m ok 0
✅ fork-hook-wins completed 13 1.0m ok 0
✅ fork-timeout-wins completed 13 1.0m ok 0
✅ unclaimed-payload-under-fork completed 17 1.0m ok 0
✅ claimed-payload-under-fork completed 17 1.0m ok 0
✅ writers-independent-step-bodies completed 12 0ms ok 0
✅ writers-scripted-tempo completed 12 0ms ok 0
✅ cancel-mid-step cancelled 7 0ms skipped 0

Full trace: world-sim.txt

#3943 migrated fetchEventsByCorrelationId's analytics branch from the
deprecated listByCorrelationId to list, and this branch removes that
branch outright, so the two edits collide on the same lines. Resolved by
keeping the removal: the run detail view reads storage, which makes the
migrated call moot rather than wrong.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

No backport to stable for 1280163 (AI decision).

The bug being fixed cannot occur on stable: verified that packages/web/app/server/workflow-server-actions.server.ts on origin/stable contains no world.analytics reads at all, so the run detail view there already goes through the storage APIs. What would actually apply on stable is not a fix — lowering MAX_CORRELATION_SEARCH_PAGES from 30 to 5 (a tuning change for a read path stable doesn't use, which would only shrink search coverage there) and deleting the orphaned fetchSteps server action and its /api/rpc method, which is an API-surface removal on a GA line rather than a stability fix.

To override, re-run the Backport to stable workflow manually via workflow_dispatch and paste this commit SHA into the ref input:

12801635511bc7e301bf8eaeb09c5fb763838826

This branch was successfully deployed

18 active deployments
Preview – workflow-swc-playground — 9e749291 Deployed Sep 3, 2026 by vercel[bot]
Preview – workflow-docs — 9e749291 Deployed Sep 3, 2026 by vercel[bot]
Preview – example-nextjs-workflow-turbopack — 9e749291 Deployed Sep 3, 2026 by vercel[bot]
Preview – example-nextjs-workflow-webpack — 9e749291 Deployed Sep 3, 2026 by vercel[bot]
Preview – workbench-sveltekit-workflow — 9e749291 Deployed Sep 3, 2026 by vercel[bot]
Preview – workbench-nuxt-workflow — 9e749291 Deployed Sep 3, 2026 by vercel[bot]
Preview – workbench-hono-workflow — 9e749291 Deployed Sep 3, 2026 by vercel[bot]
Preview – workbench-fastify-workflow — 9e749291 Deployed Sep 3, 2026 by vercel[bot]
Preview – workbench-nitro-workflow — 9e749291 Deployed Sep 3, 2026 by vercel[bot]
Preview – workbench-tanstack-start-workflow — 9e749291 Deployed Sep 3, 2026 by vercel[bot]
Preview – workbench-astro-workflow — 9e749291 Deployed Sep 3, 2026 by vercel[bot]
Preview – workflow-tarballs — 9e749291 Deployed Sep 3, 2026 by vercel[bot]
Preview – workbench-vite-workflow — 9e749291 Deployed Sep 3, 2026 by vercel[bot]
Preview – example-workflow — 9e749291 Deployed Sep 3, 2026 by vercel[bot]
Preview – workbench-express-workflow — 9e749291 Deployed Sep 3, 2026 by vercel[bot]
Preview – workbench-nestjs-workflow — 9e749291 Deployed Sep 3, 2026 by vercel[bot]
Preview – workflow-web — 9e749291 Deployed Sep 3, 2026 by vercel[bot]
Preview – workbench-python-workflow — 9e749291 Deployed Sep 3, 2026 by vercel[bot]
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.

2 participants