Skip to content

workflow: check remaining history before exit - #425

Open
fantix wants to merge 1 commit into
mainfrom
fantix/workflow-terminal-replay-check
Open

fantix wants to merge 1 commit into
mainfrom
fantix/workflow-terminal-replay-check

Conversation

@fantix

@fantix fantix commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

A workflow can return or raise before replay has checked all of its recorded events. For example, during local development:

  1. Start a run and let it suspend with a step recorded in its history.
  2. Remove that step call from the workflow code.
  3. Resume the same run, keeping its existing history.

The updated workflow can now return immediately, and the run can finish successfully without detecting the missing call.

This PR checks the remaining history after the workflow body and task cleanup finish. If it finds a mismatch, the run fails with NondeterminismError, even if the body returned a value or raised a different exception. It uses the existing replay checks without resuming workflow code or delivering results to pending operations.

This fixes a narrow edge case on its own, but it also lays the groundwork for #410, where we need to check existing history before writing pending hook registrations and disposals at the end of a run.

@fantix fantix changed the title workflow: check replay before returning or raising workflow: catch replay mismatches when a run ends Sep 29, 2026
@fantix fantix changed the title workflow: catch replay mismatches when a run ends workflow: check remaining history before exit Sep 29, 2026
Catch replay mismatches before a run ends, preparing for hook
lifecycle writes in #410.
@fantix
fantix marked this pull request as ready for review September 29, 2026 19:06
@fantix
fantix requested a review from a team September 29, 2026 19:06

This branch was successfully deployed

1 active deployment
ci — 3f14cbed Deployed Sep 29, 2026 by fantix via Test (macOS, py3.11) #1614
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