Skip to content

Preserve workflow memo upserts when continue-as-new is yielded #42

Description

@rmcdaniel

Problem

At main commit 6cc6e43eb1f63d98da434bb90f2a654b6b8db2f6, replay accumulates UpsertMemo as a pending non-blocking command. If workflow code then returns ctx.continue_as_new(...), terminal handling emits the memo update followed by ContinueAsNew. If it yields the same ContinueAsNew command, the direct continuation branch returns only that command and silently drops the pending memo update.

Those two supported authoring paths therefore produce different durable behavior. The yielded form can continue the workflow without applying the memo patch, so the successor run cannot inherit the intended merged memo.

Acceptance criteria

  • Preserve already-authored memo upserts when a workflow transitions with every supported continue-as-new authoring form.
  • Add focused replay coverage proving the first completion emits upsert_memo before continue_as_new and that replay does not emit or apply the logical memo update twice.
  • Add current-Server integration coverage proving the successor run observes the inherited merged memo across worker restart or redelivery.
  • Keep continuation handling consistent for other pending non-blocking metadata commands rather than special-casing only one workflow shape.

Delete when

Delete when returned and yielded continue-as-new paths preserve the same pending memo update sequence, and integration evidence proves the successor run receives the memo exactly once.

Metadata

Metadata

Assignees

No one assigned

    Labels

    authority:githubGitHub is the authoritative lifecycle record for this workbeta:compatibleMay be completed without changing the frozen beta contractkind:defectA public product behavior is incorrectpriority:P2Normal-priority product workrepo:sdk-pythonOwned by the Python SDK repositorystatus:readyReady for implementation

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions