Skip to content

Surface a Request ID in the run sidebar attribute panel - #3293

Merged
alangenfeld merged 3 commits into
mainfrom
alangenfeld/sidebar-request-id
Aug 3, 2026
Merged

Surface a Request ID in the run sidebar attribute panel#3293
alangenfeld merged 3 commits into
mainfrom
alangenfeld/sidebar-request-id

Conversation

@alangenfeld

Copy link
Copy Markdown
Collaborator

Summary & Motivation

One warm compute instance serves many invocations, so the Compute Instance ID already in this panel can't distinguish steps that ran inline within a single flow-function invocation — sibling steps sharing a Request ID did. It's also the value Vercel Logs indexes by, and this panel's View Logs button is where a reader takes it next.

The key is vercelId, not requestId: that's the name world-vercel stores the SDK's request id under crossing the wire, and AnalyticsEvent's sibling requestId field is declared but never written. Nothing in this repository populates vercelId on the object the panel receives yet — only AnalyticsEvent carries it, and grouping steps by invocation needs a step-level aggregation in workflow-server first — so the row ships as forward-compatible plumbing in the slot next to Compute Instance ID.

The second commit is an independent fix: sortByAttributeOrder guarded indexOf with || 0, but a miss returns -1, which is truthy, so any key absent from attributeOrder sorted ahead of every listed key. It can be dropped on its own.

Test Plan

Unit tests added; the two ordering assertions fail against the unfixed comparator. The new row could not be verified by hand — no local code path populates it.

…anel

Renders an analytics event's `vercelId` in the Metadata list as a copyable
"Request ID" — the flow-function invocation grain, finer than the
`computeInstanceId` already shown, and the value Vercel Logs indexes by (this
panel's View Logs button is where a reader takes it next).

The key is `vercelId` rather than `requestId`: world-vercel renames the SDK's
`requestId` to `vercelId` crossing the wire, and AnalyticsEvent's sibling
`requestId` field is declared but never written, so reading it would always be
empty. It needs an explicit AttributeKey entry because, like
`computeInstanceId`, it is analytics-only and not `keyof Event`.

Also route both provenance ids through a nullish-safe display fn. The analytics
schemas type them nullable and the panel only drops a row whose display fn
returns null, so the previous bare String() rendered the literal text "null"
beside the label when the backend left the field empty.

Signed-off-by: Alex Langenfeld <alex.langenfeld@vercel.com>
…er last

`sortByAttributeOrder` guarded `indexOf` with `|| 0`, but a miss returns -1,
which is truthy — so the fallback never fired and any key absent from
`attributeOrder` sorted ahead of every listed key. Rank misses as
`attributeOrder.length` instead.

`errorCode`, `isWebhook`, and `isSystem` render but were missing from the list,
so they were the keys hitting that path: a failed step showed Error Code above
its own name and module.

Signed-off-by: Alex Langenfeld <alex.langenfeld@vercel.com>
@changeset-bot

changeset-bot Bot commented Aug 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1b48598

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-shared Minor
@workflow/web Minor
@workflow/cli Patch
@workflow/nitro Patch
workflow Patch
@workflow/world-testing Patch
@workflow/nuxt Patch
@workflow/core 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

@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

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

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

@karthikscale3 karthikscale3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't need 2 changesets I think. Otherwise lgtm

Both targeted @workflow/web-shared and so merged into a single version bump
anyway. The ordering fix is cosmetic row placement in a detail panel and would
not be backported on its own, so it does not need its own changelog entry or a
separate patch bump to preserve.

Signed-off-by: Alex Langenfeld <alex.langenfeld@vercel.com>
@alangenfeld
alangenfeld merged commit a799025 into main Aug 3, 2026
57 checks passed
@alangenfeld
alangenfeld deleted the alangenfeld/sidebar-request-id branch August 3, 2026 18:05
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

No backport to stable for a799025 (AI decision).

This commit mixes feature work with a fix: adding a new vercelId/"Request ID" row (a new attribute surface, explicitly described as forward-compatible plumbing that nothing in the repo populates yet) is additive feature work carrying a minor changeset, which is never backported. The genuine fix is the sortByAttributeOrder comparator, where indexOf(...) || 0 treated a -1 miss as truthy and sorted unlisted keys (e.g. a failed step's Error Code) ahead of listed ones; a human could split that comparator fix plus its ordering tests out and force it through via workflow_dispatch.

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

a799025af97fb09161acfacf5c549801e51e1764

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