Files
vercel__workflow/packages
Pranay Prakash 37f10111a8 fix(core): render the error stack in the run-failure log (#4145)
`runtime.ts` computes a source-map-remapped `errorStack` when a run fails and
passes it to a log whose framing line — "Error while running workflow" — has
no body of its own. `composeLogLine` drops `errorStack` unconditionally, on
the assumption (true for the step executor and the combined runtime, which
render `${framing}\n${stack}`, false here) that the message already carries
it. The stack never reaches the console; #4021 noted this at the call site
and worked around it by adding `errorMessage`, but the stack itself is still
discarded.

- `composeLogLine` promotes the `errorStack` field into the stack body when
  the message carries no body of its own, so it goes through the same frame
  trimming and is still never duplicated when the caller did embed one. This
  also lets #4021's existing `body.includes(errorMessage)` check suppress the
  now-redundant `error` row at this call site.
- The header row is skipped when it would be a lone class name that the
  promoted stack header already states. A badge still always renders —
  attribution is the one thing the stack cannot express — so the step
  executor and combined-runtime sites are untouched, as is a stack naming a
  different class than `errorName`.

Adds a runtime-level regression test that drives a throwing workflow through
`workflowEntrypoint` and asserts the emitted `console.error` line carries the
message and a stack frame, plus formatter unit tests for the promote,
don't-duplicate, badge and different-class cases. No existing snapshot
changes: the composition is identical everywhere except the run-failure log.

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Co-authored-by: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>
2026-09-13 00:15:37 +00:00
..
2026-09-11 17:25:33 -07:00
2026-09-11 17:25:33 -07:00
2026-09-11 17:25:33 -07:00
2026-09-11 17:25:33 -07:00
2026-09-09 12:12:11 -07:00
2026-09-11 17:25:33 -07:00
2026-09-11 17:25:33 -07:00
2026-09-11 17:25:33 -07:00
2026-09-11 17:25:33 -07:00
2026-09-11 17:25:33 -07:00
2026-09-11 17:25:33 -07:00
2026-08-31 16:36:07 -07:00
2026-09-11 17:25:33 -07:00
2026-09-11 17:25:33 -07:00
2026-09-11 17:25:33 -07:00
2026-09-11 17:25:33 -07:00
2026-09-11 17:25:33 -07:00