Skip to content

Backport #5328: [cli] Fix BigInt crashes in inspect and stream output - #5338

Merged
VaguelySerious merged 1 commit into
stablefrom
backport/pr-5328-to-stable
Nov 9, 2026
Merged

VaguelySerious merged 1 commit into
stablefrom
backport/pr-5328-to-stable

Conversation

@github-actions

@github-actions github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Automated backport of #5328 to stable (backport job run).

AI recommendation: This is a crash fix: workflow inspect and stream output throw Do not know how to serialize a BigInt on payloads containing BigInt values. The same JSON.stringify call sites exist unchanged in packages/cli/src/lib/inspect/{output,stream}.ts on stable, so the bug affects the maintenance line. The fix is small, adds regression tests, and carries a patch changeset.

Merge conflicts were resolved by AI (opencode with anthropic/claude-opus-5.5). Please review the conflict resolution carefully before merging.

Inspecting hydrated payloads or stream chunks containing `BigInt` throws
`Do not know how to serialize a BigInt`. For example, a run returning `{
count: 9007199254740993n }` makes both `workflow inspect run <id>
--json` and `workflow inspect runs --withData` exit 1.

Use a shared JSON formatter that represents BigInt values as decimal
strings, preserving full precision in nested payloads and
newline-delimited stream output. Scalar BigInt values also display in IO
table cells. Includes regression tests and a CLI patch changeset.

- Reproduced both failures with the built CLI and a local run seeded
through the World API using the SDK serializer.
- Verified the rebuilt CLI exits 0 for the same run inspection and table
listing, plus stream inspection in JSON and human-readable modes.
Checked that `9007199254740993n` becomes `"9007199254740993"` and
subsequent stream chunks are still printed.
- `pnpm --filter @workflow/cli test` — 281 tests passed, including 11
new regression cases covering run/step/event/hook hydration, table
cells, and stream output.
- CLI build and typecheck passed; Biome checks passed with existing
warnings; `node scripts/check-changesets.mjs` and `git diff --check`
passed.

- [x] 📦 `pnpm changeset` was run to create a changelog for this PR
(patch).
- [x] 🔒 DCO sign-off passes (`git commit --signoff`).
- [ ] 📝 Ping the Workflow team once the PR is ready and the checklist is
complete.

---------

Signed-off-by: Peter Wielander <[email protected]>
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Co-authored-by: Peter Wielander <[email protected]>
Signed-off-by: Karthik Kalyan <[email protected]>
@github-actions
github-actions Bot requested review from a team and ijjk as code owners November 9, 2026 21:01
@changeset-bot

changeset-bot Bot commented Nov 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b7decee

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

This PR includes changesets to release 16 packages
Name Type
@workflow/cli Patch
workflow Patch
@workflow/world-testing Patch
@workflow/core Patch
@workflow/builders Patch
@workflow/next Patch
@workflow/nitro Patch
@workflow/vitest Patch
@workflow/web-shared Patch
@workflow/web Patch
@workflow/astro Patch
@workflow/nest Patch
@workflow/rollup Patch
@workflow/sveltekit Patch
@workflow/vite Patch
@workflow/nuxt 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 Nov 9, 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 Error Error v0 Nov 9, 2026 9:03pm UTC
example-nextjs-workflow-webpack Error Error v0 Nov 9, 2026 9:03pm UTC
example-workflow Error Error v0 Nov 9, 2026 9:03pm UTC
workbench-astro-workflow Error Error v0 Nov 9, 2026 9:03pm UTC
workbench-express-workflow Error Error v0 Nov 9, 2026 9:03pm UTC
workbench-fastify-workflow Error Error v0 Nov 9, 2026 9:03pm UTC
workbench-hono-workflow Error Error v0 Nov 9, 2026 9:03pm UTC
workbench-nestjs-workflow Error Error v0 Nov 9, 2026 9:03pm UTC
workbench-nitro-workflow Error Error v0 Nov 9, 2026 9:03pm UTC
workbench-nuxt-workflow Error Error v0 Nov 9, 2026 9:03pm UTC
workbench-python-workflow Error Error v0 Nov 9, 2026 9:03pm UTC
workbench-sveltekit-workflow Error Error v0 Nov 9, 2026 9:03pm UTC
workbench-tanstack-start-workflow Error Error v0 Nov 9, 2026 9:03pm UTC
workbench-vite-workflow Error Error v0 Nov 9, 2026 9:03pm UTC
workflow-docs Ready Ready Preview, v0 Nov 9, 2026 9:03pm UTC
workflow-swc-playground Error Error v0 Nov 9, 2026 9:03pm UTC
workflow-tarballs Error Error v0 Nov 9, 2026 9:03pm UTC
workflow-web Ready Ready Preview, v0 Nov 9, 2026 9:03pm UTC

@VaguelySerious
VaguelySerious merged commit d945101 into stable Nov 9, 2026
9 of 25 checks passed
@VaguelySerious
VaguelySerious deleted the backport/pr-5328-to-stable branch November 9, 2026 21:13
VaguelySerious added a commit that referenced this pull request Nov 10, 2026
The #5328 backport (#5338) added a test that imports showEvent and an
exported formatTableValue, which only exist on main. Export
formatTableValue and drop the single-event case, since stable has no
showEvent.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

Co-Authored-By: Peter Wielander <[email protected]>

This branch was successfully deployed

1 active deployment
Preview – workflow-docs — b7decee5 Deployed Nov 9, 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.

1 participant