Use the storage APIs for run detail views - #3944
Conversation
🦋 Changeset detectedLatest commit: 9e74929 The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
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>
Sim WorldSimulated world deterministic testing for races. Traces 🟠 world-sim scenario book — 1 fail of 41 total
Full trace: |
9bc560a to
2e77620
Compare
#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>
|
No backport to The bug being fixed cannot occur on To override, re-run the Backport to stable workflow manually via |
The run detail view was reading a run's events and step timeline from
world.analyticswhile 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:
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
fetchStepsserver action and its/api/rpcmethod. The trace viewer has built its spans from events since the observability data-fetching refactor, which leftfetchStepsthe only/api/rpcmethod 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 --localUiand local development are unchanged.Backporting
Not for
stable. 4.x has no analytics namespace, sopackages/webthere already reads the run detail view through the storage APIs — the bug this fixes cannot occur on that line.fetchStepsis orphaned onstabletoo, so that half would technically apply, but removing an/api/rpcmethod is a behaviour change on a GA line rather than a stability fix, and not worth backporting on its own.