Repository navigation
Move pending stream messages to the continued run at continue-as-new - #1019
Merged
Merged
Conversation
Continue-as-new copied only the message cursor, in both the embedded executor and the worker bridge, so a stream message still pending when a run continued as new stayed on the closed run and was never received (#1018). Both paths now call MessageService::transferMessagesToContinuedRun. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rmcdaniel
changed the base branch from
fix/1013-redrive-pending-messages
to
main
November 4, 2026 03:22
|
Member
Author
|
General interim review (Security unavailable), exact head
Without #1017, the next signal still hides moved messages. Merge this together with #1017, after #1017's H1 is fixed. Hold 2.20.2 until then. |
Member
Author
|
Merged on General interim clearance of exact head
|
Merged
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



Fixes #1018. This PR is stacked on #1016 (the #1013 fix): its base is
fix/1013-redrive-pending-messages, and I'll retarget it tomainonce #1016 merges. Both are planned for 2.20.2.Problem
Continue-as-new copied only the message cursor (
MessageStreamCursor::transferCursor), in two places:WorkflowExecutor, at continue-as-new);DefaultWorkflowTaskBridge, when an external worker completes a task withcontinue_as_new).An inbound stream message keeps the
workflow_run_idof the run that was current when it arrived, andinbox()->receive()reads only the receiving run's rows. So a message still pending at continue-as-new stayed on the closed run and was never received. Signals weren't affected; accepted, unapplied signals already move.Fix
Both paths now call
MessageService::transferMessagesToContinuedRun($run, $continuedRun), right after the instance'scurrent_run_idswitches. That moves pending inbound rows and the cursor together. New messages after that point already target the continued run.Tests (each fails with the fix removed)
V2MessageStreamReplayTest::testAContinuedRunReceivesAMessageThatWasPendingAtContinueAsNew(embedded, new fixtureTestMessageStreamContinueAsNewWorkflow):m1and continues as new, withm2still pending.m2. Without the fix it getsnull.V2WorkflowTaskBridgeTest::testContinueAsNewMovesPendingStreamMessagesToTheContinuedRun(worker bridge): a message pending when the worker completes withcontinue_as_newends up on the continued run. Without the fix it stays on the old run.continue-as-new-pending-message-transfer.jsonplus the scenariotestContinueAsNewPendingMessageCorpusReachesTheContinuedRun. It fails without the fix.Local results
ReplayRegressionCorpusTestpasses 101/101.The docs agent is correcting
message-streams.mdandcontinue-as-new.md, which claimed this transfer already happened.🤖 Generated with Claude Code