Files
vercel[bot] fde116558e [core] Complete a due wait even when its run is already terminal
A pending wait parks a delayed continuation message on the workflow queue;
when it fires, the delivery's job is to record the wait's `wait_completed`.
If the run finished first — a `Promise.race([sleep('1h'), hook])` whose hook
won, a cancellation, a failure — every path that discovers the terminal state
returned and acked without writing it, so the wait stayed open in the log
forever: replay, `inspect`, and the dashboard timeline all read a run that
terminated while still sleeping.

The completion is now unconditional on run status. On a terminal run it is all
the delivery does — no replay, no suspension dispatch — and the message is
acked only after the write settles, so a transient World failure redelivers
instead of dropping the completion. Not-yet-due waits are left to their own
continuations.

The Worlds refused the write too: a terminal transition reaps the run's waits
(`run.resources-released`), and `wait_completed` against a reaped wait was
`Wait "…" not found`. world-local, world-postgres, and world-sim now accept it
and record the event without resurrecting the entity, deduplicating against
the surviving `.completed` claim (local) or the event log (postgres, sim).
Older backends that still refuse are logged and acked rather than nacked —
redelivery cannot change that verdict.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

Co-Authored-By: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>
2026-08-22 17:03:45 +00:00
..
2025-10-23 12:07:52 +03:00
2025-10-23 12:07:52 +03:00
2025-10-23 12:07:52 +03:00
2025-10-23 12:07:52 +03:00
2025-10-23 12:07:52 +03:00

Workflow SDK Docs

Check out the docs here