Repository navigation
[cli] Fix BigInt crashes in inspect and stream output - #5328
Conversation
Signed-off-by: Karthik Kalyan <[email protected]> Co-Authored-By: Karthik Kalyan <[email protected]>
🦋 Changeset detectedLatest commit: d3e8bd0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 17 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 |
🧪 E2E Test Results✅ All tests passed 🛠 Infra Events (absorbed by the harness)Platform anomalies the e2e harness detected and worked around (e.g. a run the queue never picked up, replaced by a fresh run). Clustered timestamps indicate a backend blip; a steady drip indicates a platform issue worth escalating.
E2E Test SummarySummary
Details by Category✅ ▲ Vercel Production
✅ 💻 Local Development
✅ 📦 Local Production
✅ 🐘 Local Postgres
✅ 🪟 Windows
✅ 🌐 Cross-language Conformance
✅ dynamic-runs
✅ local-postgres-spec9
✅ vercel-http-transport
✅ vercel-multi-region
✅ vercel-spec9
✅ vercel-ws-transport
|
📊 Workflow Benchmarkscommit Backend:
📈 STSO distribution vs main (inline / queue-hop histograms)1020 steps (inline) Cumulative STSO time: main 122774ms → this run 103525ms (Δ -19249ms, -16%) ℹ️ Metric definitions & methodologyThe collapsed STSO distribution section above buckets every step gap, split inline (same warm process — pure framework overhead) vs queue-hop (fresh process — dispatch, reinit, replay). Best/P75/P90/P99 deltas compare against the most recent benchmark run on Metrics — TTFS: time to first step body (in-deployment start() → first step body) · Fan-out TTFS: fan-out time to first step (in-deployment start() → first of the parallel step bodies to complete) · Fan-out TTLS: fan-out time to last step (in-deployment start() → last of the parallel step bodies to complete, i.e. when the Promise.all resolves) · STSO: step-to-step overhead (gap between consecutive step bodies) · WO: workflow overhead (whole-run time outside step bodies, in-deployment anchored) Scenarios — step: one trivial no-op step, no stream; no hooks, so the run stays in turbo mode (in-process fast path) · stream: one streaming step; no hooks, so the run stays in turbo mode (in-process fast path) · hook + stream: registers a hook before one step, which exits turbo mode (dispatch path) · 1020 steps: 1020 trivial sequential steps; STSO is measured between consecutive steps in the given step ranges, and WO is the whole-run overhead outside step bodies · Promise.all(100 steps): 100 trivial no-op steps started together in a single Promise.all; Fan-out TTFS is the first of them to complete and Fan-out TTLS the last, both from the in-deployment clientStart, so their gap is the spread the runtime adds across the fan-out 🔴 marks a percentile over its target (within target is left unmarked). Targets (p75/p90/p99, ms) — TTFS 200/300/600 All timestamps are deployment-side; runs are triggered in-deployment, so the CI runner and api.vercel.com sit outside every measured window. TTFS = Cold starts stay in the numbers (real bursty-workload latency, inflates P75+); Best is the warm floor. |
Sim WorldSimulated world deterministic testing for races. Traces 🟢 world-sim scenario book — 0 fail of 45 total
Full trace: |
Signed-off-by: Peter Wielander <[email protected]>
About these numbersSizes are gzip; parentheses show the change against
|
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]>
|
Backport PR opened against |
…#5338) Automated backport of #5328 to `stable` ([backport job run](https://github.com/vercel/workflow/actions/runs/42698118020)). Signed-off-by: Peter Wielander <[email protected]> Signed-off-by: Karthik Kalyan <[email protected]> Co-authored-by: Peter Wielander <[email protected]>
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]>
Description
Inspecting hydrated payloads or stream chunks containing
BigIntthrowsDo not know how to serialize a BigInt. For example, a run returning{ count: 9007199254740993n }makes bothworkflow inspect run <id> --jsonandworkflow inspect runs --withDataexit 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.
How did you test your changes?
9007199254740993nbecomes"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.node scripts/check-changesets.mjsandgit diff --checkpassed.PR Checklist - Required to merge
pnpm changesetwas run to create a changelog for this PR (patch).git commit --signoff).