Skip to content

Replay a redriven run with the failed run's start time #232

Closed

Description

@rmcdaniel

Problem

When a failed run is redriven, the new run's history starts with a WorkflowStarted whose recorded_at is the redrive time. Embedded Core replays such a run from the failed run's start time, carried as WorkflowStarted.replayed_started_at. The Python SDK ignores that key. ctx.now() and anything derived from the start clock, such as ctx.uuid7(), return redrive-time values in the new run.

Workflow code that reads the clock before the failed step therefore gets different values than the failed run did, so retried activity arguments or branches can change. This was reproduced by cold-replaying a hand-built redriven history with the current SDK: the reused side effect, version marker, timer and activity all replayed correctly, but ctx.now() returned 10:05 (the redrive) instead of 10:00 (the failed run's start).

The SDK also does not read the per-step reused_from_run_id / reused_recorded_at keys that workflow#991 and #992 add to ActivityCompleted, SideEffectRecorded, VersionMarkerRecorded and TimerFired.

Expected

  • When recovery_kind == "redrive" and replayed_started_at is present, use it as the run start time for the workflow clock.
  • Accept the reused keys on the four events, and prefer reused_recorded_at wherever the SDK reads an event's time.

Acceptance

  • A redriven history with a reused side effect, version marker, fired timer and activity replays cold to the same next command as Core's redrive-reused-markers-clock and redrive-reused-timer-clock fixtures.
  • ctx.now() equals the failed run's start time.
  • test_history_event_contract.py lists the new keys.
  • The clock docs cover redrive.

Context: workflow#864 (part C).

Activity

  1. added
    kind:defectA public product behavior is incorrect
    priority:P2Normal-priority product work
    on Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind:defectA public product behavior is incorrectpriority:P2Normal-priority product work

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions