Commit Graph

1198 Commits

Author SHA1 Message Date
github-actions[bot] 772dbecb06 Version Packages (#4053)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
workflow@4.8.7
2026-09-09 09:52:10 -07:00
Karthik Kalyan 0e56bb864d [world-vercel] Backport retryable run creation stream failures (#4045) 2026-09-09 09:35:06 -07:00
github-actions[bot] 6914a1cb69 Version Packages (#3834)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
workflow@4.8.6
2026-09-08 17:07:30 -07:00
Karthik Kalyan 0deceda53a [world-vercel] Backport post-header stream recovery (#4041) 2026-09-08 16:43:08 -07:00
github-actions[bot] 0b9867ebf8 fix(swc-plugin): register class expressions via an IIFE instead of by name (#3971) (#4013)
* fix(swc-plugin): register class expressions via an IIFE and reject unnameable classes

Class expressions with "use step" methods or custom serialization were
registered by module-level statements referencing the class by name. When no
module-scope binding could be resolved the plugin fell back to a placeholder
`AnonymousClass` identifier, which is a guaranteed ReferenceError at module
evaluation (vercel/workflow#3929). Other shapes were silently wrong as well:
`var A = class {}, B = class {}` registered A's steps under B, `X = class {}`
assignments and classes nested inside functions emitted unresolvable
references.

Class expressions are now wrapped in a single IIFE that receives the class,
performs every registration recorded for it, and returns it, so the
registration no longer depends on a name being in scope. The class name is
still needed for step/class IDs and is derived from the assigned variable,
the class's own identifier, or the property key it is assigned to
(`exports.Foo = class {}`, `{ Foo: class {} }`). When none is available, or
the class is declared inside a function, the plugin emits a compile error
instead of broken code.

Class declarations keep their existing module-level output; the emitters
were factored so both paths share the same statement builders.

* fix(swc-plugin): generate names for anonymous class expressions instead of erroring

With registration happening inside the IIFE, an anonymous class expression
in a position that provides no name (`foo(class { ... })`, an array element,
a conditional branch) only needs a name for its step/class IDs. Generate a
deterministic `AnonymousClass<N>`, counting only anonymous classes that have
something to register, instead of rejecting them. Classes declared inside a
function remain an error.

Dead-code elimination now keeps module-level declarations whose initializer
contains a wrapped class expression: evaluating the initializer is what
registers the class, and the binding may be otherwise unreferenced.

Signed-off-by: Nathan Rajlich <n@n8.io>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-08 19:59:51 +00:00
github-actions[bot] bf5cd3a033 Prevent payload flicker during decryption (#3906) (#3907)
Signed-off-by: Karthik Kalyan <105607645+karthikscale3@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-31 14:13:58 -07:00
github-actions[bot] 680c2631ed fix(next): discover every Next entrypoint (#3801) (#3881)
* fix(next): discover every Next entrypoint

* fix(next): exclude declaration files from entries

* fix(next): align entry discovery with Next

* Revert "fix(next): align entry discovery with Next"

This reverts commit 7e16d144e5.

* fix(next): tighten entrypoint discovery

Signed-off-by: Nathan Colosimo <110621881+NathanColosimo@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-28 22:00:37 +00:00
github-actions[bot] 7024b5b00e [world-vercel] Fix deploymentId "latest" resolving against the wrong team (#3844) (#3848)
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-27 14:28:28 -07:00
github-actions[bot] 41abe2dda3 fix(world-local): abort deliveries on shutdown (#3824) (#3827)
Signed-off-by: Andrew Barba <barba@hey.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-26 15:17:01 -07:00
github-actions[bot] 9969f9eeea Version Packages (#3697)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
workflow@4.8.5
2026-08-25 08:26:29 -07:00
github-actions[bot] 0fd781a3e2 [world-local] Reduce sequential replay I/O (#2152) (#2707)
Co-authored-by: Pranay Prakash <pranay.gp@gmail.com>
2026-08-25 07:35:24 -07:00
github-actions[bot] 699e01ed16 Fix namespaced active run recovery (#2888) (#2889)
Co-authored-by: Casey Gowrie <casey.gowrie@vercel.com>
2026-08-24 23:20:42 +00:00
github-actions[bot] 853a316c79 Verify stream completion on clean EOF in the reconnecting framed reader (#3564) (#3588)
Long live reads were ending silently at the server's 2-minute connection
cap: the max-duration abort reaches the client as a clean EOF on some
transport paths, and the reader read that as end-of-stream. On EOF it
now consults `streams.getInfo` and reconnects from the next chunk unless
the stream is done and every chunk up to the tail was delivered. A
failed metadata read trusts the EOF, so a transient blip can't fail a
healthy completion.

Tests added for the reconnect, verified-completion, metadata-failure,
and reconnect-budget paths.

---------

Signed-off-by: Alex Langenfeld <alex.langenfeld@vercel.com>
Signed-off-by: Alex Langenfeld <alexlangenfeld@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Pranay Prakash <pranay.gp@gmail.com>
2026-08-24 15:40:25 -07:00
github-actions[bot] cd9343b324 fix(core): preserve order across adjacent hook deliveries (#3552) (#3557)
Signed-off-by: Andrew Barba <barba@hey.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-24 15:39:59 -07:00
github-actions[bot] 2ced7cc05c fix(world-postgres): throw EntityConflictError on duplicate run_created (#2983) (#2992)
Signed-off-by: Joey Hotz <joeyhotz1@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-24 15:38:33 -07:00
github-actions[bot] 2cf8838f7b Backport #2908: Fix Nitro cleanup for React Router and add setup guides (#2923)
* Fix Nitro cleanup for React Router and add setup guides (#2908)

* fix(nitro): support React Router Vite builds

* refactor(nitro): simplify React Router cleanup

* docs(react-router): specify cleanup version

* fix(nitro): close temporary Vite servers

Signed-off-by: Nathan Colosimo <110621881+NathanColosimo@users.noreply.github.com>

* fix Nitro React Router stable backport

* scope Nitro cleanup to Vite builds

* remove unnecessary esbuild service shutdown

Signed-off-by: Nathan Colosimo <110621881+NathanColosimo@users.noreply.github.com>

---------

Signed-off-by: Nathan Colosimo <110621881+NathanColosimo@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Colosimo <110621881+NathanColosimo@users.noreply.github.com>
2026-08-24 15:37:48 -07:00
github-actions[bot] 4c93a5fe45 Backport #2914: Add WORKFLOW_LOCAL_RECOVER_ACTIVE_RUNS env var to local world (#2921)
* feat(world-local): add WORKFLOW_LOCAL_RECOVER_ACTIVE_RUNS env var (#2914)

The recoverActiveRuns factory option had no environment variable, so
disabling startup re-enqueueing of pending/running runs required a custom
world module via WORKFLOW_TARGET_WORLD. Wire an env fallback
(0/false disables, 1/true enables, explicit factory option wins) and
document it in the worlds configuration reference and local world guide.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Karthik Kalyan <105607645+karthikscale3@users.noreply.github.com>

* Fix: Destructuring a non-existent `clearCache` property from `createStorage()` return causes TS2339 build failure in `packages/world-local/src/index.ts`

This commit fixes the issue reported at packages/world-local/src/index.ts:65

## Bug

At `packages/world-local/src/index.ts:65` the backport introduced:

```ts
const { clearCache: clearStorageCache, ...storage } = createStorage(
  mergedConfig.dataDir,
  tag
);
```

`createStorage` returns `LocalStorage`, defined in `storage/index.ts:13` as:

```ts
export type LocalStorage = Omit<Storage, 'runs'> & { runs: LocalRunsStorage };
```

On the `stable` branch this type has **no** `clearCache` property (a repo-wide grep found no `clearCache` definition anywhere under `packages/world-local/src` — the only match was this destructuring itself). Destructuring a property that doesn't exist on the type triggers:

```
src/index.ts(65,11): error TS2339: Property 'clearCache' does not exist on type 'LocalStorage'
```

Additionally, `clearStorageCache` was never referenced after being bound, so even if the property existed it would be dead code.

**Trigger:** Any `tsc` build/typecheck of the `world-local` package fails deterministically — all 15 deployment builds reported the identical error.

## Fix

The `clearCache` destructuring is unrelated to the intended backport (which is only the `resolveRecoverActiveRuns` env-var fallback). Reverted line 65 to the original form:

```ts
const storage = createStorage(mergedConfig.dataDir, tag);
```

This removes the reference to the non-existent property while preserving the env-var feature, resolving the TS2339 error.

Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: VaguelySerious <mittgfu@gmail.com>

---------

Signed-off-by: Karthik Kalyan <105607645+karthikscale3@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: VaguelySerious <mittgfu@gmail.com>
2026-08-24 15:37:20 -07:00
github-actions[bot] 9a9945d444 [ai] Reduce doStreamStep step boundary payload (#1932) (#2674)
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-24 15:34:09 -07:00
github-actions[bot] 53fb5bf848 [docs] Reduce noise in changelog files (#2075) (#2219)
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-24 15:32:27 -07:00
github-actions[bot] e0328a84dd fix(world-postgres): make step creation atomic (#3575) (#3746)
Signed-off-by: Shin <128954611+shin4141@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-24 15:31:05 -07:00
Karthik Kalyan 5fa20ea20a Scope correlation-ID event lookups to a run (#3762)
* fix: scope correlation event lookups by run

* Update .changeset/quiet-walls-dream.md

Co-authored-by: Peter Wielander <mittgfu@gmail.com>
Signed-off-by: Karthik Kalyan <105607645+karthikscale3@users.noreply.github.com>

---------

Signed-off-by: Karthik Kalyan <105607645+karthikscale3@users.noreply.github.com>
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
2026-08-24 15:01:05 -07:00
github-actions[bot] 59745aaec7 [ci] Keep workflow-server override formatting stable (#3713) (#3726)
Co-authored-by: Shalabh Chaturvedi <shalabh.chaturvedi@vercel.com>
2026-08-21 14:18:53 -07:00
github-actions[bot] 608769dc5f [core] Pin draw order to event-log order: retire delivery barriers through one ordered dispenser (#3554) (#3629)
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
2026-08-21 12:47:49 -07:00
github-actions[bot] 5556b4cde5 fix(core): make step-argument serialization failures catchable in workflow code (#3675) (#3687)
* fix(core): make step-argument serialization failures catchable in workflow code

A step whose arguments fail to serialize is now finalized by the
suspension handler as step_created + step_failed (mirroring a step-body
failure) instead of rejecting the whole suspension. The next replay —
forced in-process, since no step message is dispatched for the failed
step — rejects the step's promise with the SerializationError, so a
try/catch around the step call observes it. Uncaught, the error
propagates out of the workflow body and fails the run as a fatal
USER_ERROR immediately, instead of redelivering the orchestrator
message until max deliveries (49/48) as reported in production on v4.

* Serialize the step_failed error with the VM global; one-sentence changeset

Addresses review feedback: dehydrateStepError in
finalizeUnserializableStep now receives suspension.globalThis like every
other dehydration in this file. Error detection is realm-independent, so
the host-created SerializationError serializes identically, but VM-realm
values guest code threw into the cause chain are now detected by the
realm-sensitive reducers.

* Address review: QuickJS engine support, deferred-batch join, drain gate, placeholder marker, telemetry, docs

- QuickJS: dumpPendingOps now catches a step input's serialization
  failure per-op, reframes it as a SerializationError with the same
  framed message as dehydrateStepArguments, and surfaces it on the
  pending op instead of failing the whole collection. The entrypoint's
  dispatchPendingOps finalizes such steps as step_created (placeholder
  input) + step_failed, excludes them from inline claims and queue
  publishes, marks them handled, and raises the requeue signal so the
  failure is observed even when the feed lags — mirroring the node:vm
  engine, so both engines agree: catchable in workflow code, USER_ERROR
  with the framed message when uncaught. Both step-argument e2e tests
  now pass on WORKFLOW_VM=quickjs.
- runtime.ts: the failed-step replay path now joins
  suspensionResult.deferredBatchWork before continuing, so a trailing
  chunk commit or step-message publish rejection propagates instead of
  being swallowed after ack; committed inline claims are documented as
  deliberately handed to owned recovery.
- Terminal drain: finalization is gated on a stepDispatch target. The
  drain caller has no replay to observe a finalization, so a completed
  run no longer gains failed-step rows for an unawaited unserializable
  step — the rethrown error is swallowed by the drain's catch,
  preserving its pre-existing behavior.
- The placeholder input now carries a marker string ('[input
  unavailable: step argument serialization failed]', shared via
  runtime/unserializable-step.ts) so inspect/o11y don't render the
  failed step as a genuine zero-argument call.
- New workflow.steps.failed_serialization span attribute on the
  suspension span, so occurrence is measurable without log search.
- Docs: v5 serialization-failed error page documents where each
  boundary's failure surfaces (catchable step failure vs run failure)
  and the no-retry USER_ERROR semantics; foundations/errors-and-retries
  gains a Serialization Failures section with the try/catch shape.

* Guard the finalization crash window; self-contained docs samples

- A crash or transient failure between finalization's two durable
  writes leaves a lone placeholder step_created, and redelivery then
  dispatches the step through normal crash recovery — previously
  running user code with the placeholder arguments. The placeholder
  now carries a structural flag on the input triple's top level (which
  user code never controls, so no false positives), and the step
  executor checks it after hydration: instead of running the body, it
  throws the intended fatal SerializationError, completing the
  interrupted finalization as step_failed. Applies to both engines
  (they share the placeholder and the executor).
- Regression tests: executor fails a placeholder-input step without
  running the body (and doesn't trip on a genuine argument equal to
  the display marker); handleSuspension rejects for redelivery when
  step_failed can't be written after step_created landed, leaving the
  recoverable placeholder behind; mixed bad-step + large fan-out
  returns the failure set alongside still-pending deferredBatchWork
  whose rejection surfaces — the contract the runtime's failed-step
  join (added previously) relies on.
- Docs: the two new code samples are now self-contained so the docs
  code-sample typecheck passes.

Signed-off-by: Nathan Rajlich <n@n8.io>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-20 18:44:04 +00:00
github-actions[bot] c0a0f09ab6 Version Packages (#3669) workflow@4.8.4 2026-08-19 16:13:09 -07:00
github-actions[bot] 0f7f498c2f fix(world-postgres): refuse a hook resume that races the disposal (#3645) (#3663)
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-19 13:13:31 -07:00
github-actions[bot] e331cd6aa9 Backport #3461: [world] Add WORKFLOW_NODE_HTTP to run the HTTP Worlds on node:http (#3643)
Co-authored-by: Peter Wielander <peter.wielander@vercel.com>
2026-08-19 12:40:57 -07:00
github-actions[bot] 234b904a73 [e2e] Assert only the positive direction of step source maps (#3620) (#3624)
Co-authored-by: Alex Langenfeld <alex.langenfeld@vercel.com>
2026-08-18 14:29:53 -07:00
github-actions[bot] fda59a0407 Version Packages (#3506) workflow@4.8.3 2026-08-14 15:57:59 -07:00
Simon H 598d712173 fix: Better loading of SvelteKit routes directory (#3474)
Instead of accessing private files from SvelteKit, we use `@sveltejs/load-config` to load the Svelte config (that package also knows about checking Vite config). The deadlock is avoided by having a module-level `Set` to see if we're currently recursing or not.

This is necessary for SvelteKit 3 since there the config lives exclusively in the vite config, and the previous logic did not handle that.

This also uncovered that we're needlessly rebuilding the generated files in sub builds/workers (SvelteKit, at least below 3, starts off secondary builds; and some things are done in workers), which a new file cache now checks.

---------

Signed-off-by: Simon Holthausen <simon.holthausen@vercel.com>
2026-08-12 22:24:27 +02:00
github-actions[bot] 444c259677 Version Packages (#3436) workflow@4.8.2 2026-08-11 11:01:18 -07:00
github-actions[bot] 86bc00050f Gate the unconsumed-event check on delivery idleness (#3439) (#3442) 2026-08-11 02:15:41 +00:00
github-actions[bot] 6f301ba396 Backport #3139: fix(core): order step-result deliveries against wait/hook deliveries by event-log position (#3173)
Co-authored-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
Co-authored-by: Peter Wielander <peter.wielander@vercel.com>
2026-08-10 17:46:52 -07:00
github-actions[bot] e822a6a173 fix(core): preserve new.target in the deterministic Date override so Date subclasses work (#3372) (#3434)
* test: add failing test for Date subclassing in workflow VM




* fix(core): preserve `new.target` in the deterministic `Date` override so `Date` subclasses work in workflow functions

The VM's `Date` override was a plain function, so `class X extends Date`
lost the subclass identity: `super()` returned a fresh plain `Date` that
became `this`, dropping the subclass's methods and fields. This silently
broke `Date` subclasses like `TZDate` from `@date-fns/tz`.

Using `class Date extends Date_` keeps `new.target` intact, and `extends`
already wires up the prototype chain and statics, so the manual
`prototype` assignment and `Object.setPrototypeOf` fix-ups are no longer
needed. Determinism is unchanged: zero-arg construction still returns the
fixed timestamp and `Date.now()` is still overridden.

Fixes #3371




* test: add failing test for calling `Date()` without `new`




* fix(core): keep `Date()` callable without `new`

Use a plain function that branches on `new.target` and constructs via
`Reflect.construct(Date_, args, new.target)` instead of a class: subclassing
still works (`new.target` is forwarded), and calling `Date()` without `new`
now matches the spec — arguments are ignored and the (fixed) time string is
returned, where the previous override returned a `Date` object.




* chore: update changeset to match the final `Reflect.construct` implementation




---------

Signed-off-by: ar_tama <arata.makoto@gmail.com>
Signed-off-by: Makoto Arata <arata.makoto@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-10 23:15:02 +00:00
github-actions[bot] c8d4a354ed Version Packages (#3380) 2026-08-06 18:33:17 -07:00
Peter Wielander 30da02423f Backport #3370: [world-vercel] Recover from wedged HTTP/2 events connections (#3375) 2026-08-06 17:44:23 -07:00
github-actions[bot] 328653a7a2 Version Packages (#3223) workflow@4.8.0 2026-07-31 11:12:10 -07:00
Peter Wielander 7fd2e4a4e0 [world-vercel] Backport the optimized HTTP/2 transport to stable (#3233) 2026-07-30 19:59:15 -07:00
github-actions[bot] 72ea6c8ede Backport #2986: Implement max_events per run limit (#3042) 2026-07-30 14:26:13 -07:00
github-actions[bot] 2fe2d88fd7 [world-local] Retry transient EPERM unlink failures on Windows (#3215) (#3221) 2026-07-30 12:59:57 -07:00
github-actions[bot] 99d1a0ce14 Version Packages (#3105) workflow@4.7.0 2026-07-28 17:40:43 -07:00
Peter Wielander 9d8b293f88 fix(world-vercel): bound HTTP timeouts and retry transport timeouts (#3169) 2026-07-28 16:50:09 -07:00
github-actions[bot] f2714c50bb Pass the webhook request through without buffering its body (#3166) (#3174)
The Astro and SvelteKit webhook wrappers copied the incoming request via
`normalizeRequest()`, which buffers the whole body with `arrayBuffer()`,
before calling the handler that validates the webhook token. Requests
carrying an unknown token therefore did unnecessary work before being
rejected.

The copy turns out to be unnecessary: both frameworks already hand the
route a standard `Request`, so the webhook wrappers now pass it straight
to the handler. The body is left untouched until `resumeWebhook()` has
accepted the token.

The flow route keeps `normalizeRequest()` for now — it authenticates via
the queue trigger rather than a URL token, so the ordering does not
matter there, and whether the shim is needed at all is a separate
question.

Note that the Astro dev server buffers request bodies upstream of the
route handler, so the new behavior is only observable in built output;
the node adapter and Vercel builds both benefit.

Signed-off-by: Nathan Rajlich <n@n8.io>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-28 16:35:54 -07:00
Peter Wielander 63fe524dc0 Revert "Publish 4.x under the previous dist-tag (#3091)" (#3168)
This reverts commit 3b839446a9.
2026-07-28 14:14:16 -07:00
github-actions[bot] 6f234bd09c fix: upgrade postcss to >=8.5.18 to address GHSA-r28c-9q8g-f849 (#3102) (#3103)
Signed-off-by: Nathan Rajlich <n@n8.io>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-24 17:31:57 -07:00
github-actions[bot] c77a82d708 [world-testing] Isolate each spawned test server's data directory (#3055) (#3104)
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
2026-07-24 17:00:49 -07:00
Peter Wielander 12e4ef7ea1 Backport #2266 + #2946: precondition guard for event creation (#3079) 2026-07-24 16:18:48 -07:00
Peter Wielander 3b839446a9 Publish 4.x under the previous dist-tag (#3091) 2026-07-24 16:16:53 -07:00
github-actions[bot] 603cd34882 Version Packages (#3074) workflow@4.6.2 2026-07-24 12:35:36 -07:00
github-actions[bot] 58fb594768 Backport #3071: fix: upgrade next to 16.2.11 to address CVE-2026-64641 (#3073)
Co-authored-by: Nathan Rajlich <n@n8.io>
Co-authored-by: VaguelySerious <mittgfu@gmail.com>
2026-07-23 15:45:51 -07:00