SAA / WFA parity fix: do not reset heartbeats by default (#11417)
commit c67946b ↗ · temporalio/temporal · · committed Aug 5, 2026 · +407−241 · base 3e923ba44c7e
Agent prompt
what a new run launched now would send
Activity reset currently always discards persisted heartbeat checkpoint details. That default is wrong and breaks parity with workflow-activity reset behavior.
Desired product behavior: resetting an activity should rewind the attempt counter (so retry backoff starts fresh) while preserving the last heartbeat checkpoint, so a long-running activity can resume from its progress. Clearing heartbeats must be opt-in via the existing reset_heartbeat / ResetHeartbeat flag on the reset APIs.
This must hold for every reset path: immediate reset, reset with keep-paused, and deferred reset requested while a worker still owns an attempt (the in-flight attempt and its checkpoint stay undisturbed until the worker yields; only then apply keep-vs-clear). If a cancel supersedes a pending deferred reset, drop any deferred intent to clear heartbeats. Standalone activity reset forwarding must pass through the client's ResetHeartbeat value instead of forcing clear.
Acceptance: default reset → attempt rewound, heartbeat details still present; ResetHeartbeat=true → details cleared; reset-while-started → checkpoint remains visible until the attempt yields, then the same keep/clear policy applies.
Interface contract — the change must expose exactly this surface:
Persist deferred clear intent on activity state as reset_should_clear_heartbeat / ResetShouldClearHeartbeat (consumed when the deferred reset lands). Model reset events must carry ResetHeartbeat; parity tests use a Reset variant with ResetHeartbeat=true (ResetClearingHeartbeat).
Work only inside this repository checkout. Make the code change the task
describes, keeping the diff focused — no drive-by refactors.
When you are done, leave your changes committed or in the working tree;
they are collected automatically.
Stay on this snapshot checkout (`task/ycb_temporal_cc67946bbcba5`). Never checkout, pull, or rebase onto `main`. That branch is a README-only orphan.
Stay on this HEAD. Do not fetch another default branch. Push only on the Cursor-created `crazy-cursor/…` side branch from this HEAD.
Some past runs of this task were launched with a different prompt (the prompt template changed since, or those runs predate this benchmark's stored prompt). Each run persists the exact prompt it sent at launch — that per-launch record is the audit trail; this page shows only the current one.
Reference diff
The task commit's diff against its first parent — the judge's comparison target.