You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AI recommendation: This is a pure correctness fix (patch changeset) for a real defect that exists on stable: the unconsumed-event check's fixed DEFERRED_CHECK_DELAY_MS window races in-flight deliveries and raises a spurious ReplayDivergenceError, which escalates to CorruptedEventLogError and kills otherwise healthy runs. The touched files (packages/core/src/events-consumer.ts, private.ts, workflow.ts) all exist on stable with the same timing-bet logic, and the change adds only an internal predicate plus tests, no user-facing API or feature. Note that stable lacks the hasParkedCommittedDelivery/delivery-barrier machinery from #3183, so the cherry-pick will need adaptation and careful review.
Merge conflicts were resolved by AI (opencode with anthropic/claude-opus-5). Please review the conflict resolution carefully before merging.
(AI) Rebased onto current stable and resolved the conflict.
What caused it: the branch was cut when stable was at e822a6a173. Since then #3173 (backport of #3139) landed, which adds the delivery-barrier machinery to private.ts. The PR description's note that "stable lacks the hasParkedCommittedDelivery/delivery-barrier machinery" is now stale.
Resolution: because stable now has hasParkedCommittedDelivery and awaitEarlierDeliveries, the adaptation is no longer needed and the change converges on upstream. isDeliveryIdle / scheduleWhenIdle are now byte-identical to main:
The previous resolution had adapted this to pendingDeliveries === 0 alone. Keeping that would have been a regression: scheduleWhenIdle on stable checks pendingDeliveries > 0 || hasParkedCommittedDelivery(ctx), so routing it through a predicate that drops the second half would have silently reverted part of #3173. hasParkedCommittedDelivery stays unexported (nothing on stable imports it); the only other deviation from main is the two pre-existing stable gaps, no retained-session append() and no WORKFLOW_DEFERRED_CHECK_DELAY_MS override knob (envNumber does not exist in stable's world package), so the delay stays the DEFERRED_CHECK_DELAY_MS constant.
Validation:@workflow/core builds, typechecks, and all 836 src/ unit tests pass (the 6 e2e/ failures locally are the usual unbuilt-workbench/env-dependent ones).
Worth flagging for review: the shipped unconsumed-check-delivery-idle.test.ts only ever drives pendingDeliveries and leaves pendingDeliveryBarriers empty, so it passes under either version of the predicate. I wrote a throwaway test (not committed) that registers an armed step barrier with pendingDeliveries === 0, the parked-committed window from #3183. It fails 2/2 under the dropped-guard version and passes here. delivery-barrier-coverage.test.ts:536 also catches it, so CI would have gone red rather than merging the regression silently.
The workbench-python-workflow deployment failure is pre-existing: it fails on stable (6f301ba396) and on the previous PR head too.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated backport of #3439 to
stable(backport job run).AI recommendation: This is a pure correctness fix (patch changeset) for a real defect that exists on
stable: the unconsumed-event check's fixedDEFERRED_CHECK_DELAY_MSwindow races in-flight deliveries and raises a spuriousReplayDivergenceError, which escalates toCorruptedEventLogErrorand kills otherwise healthy runs. The touched files (packages/core/src/events-consumer.ts,private.ts,workflow.ts) all exist onstablewith the same timing-bet logic, and the change adds only an internal predicate plus tests, no user-facing API or feature. Note thatstablelacks thehasParkedCommittedDelivery/delivery-barrier machinery from #3183, so the cherry-pick will need adaptation and careful review.Merge conflicts were resolved by AI (opencode with
anthropic/claude-opus-5). Please review the conflict resolution carefully before merging.