Add CallbackRequestID to workflow execution for use by CHASM Schedules (#9479)
commit ff2754a ↗ · temporalio/temporal · · committed Mar 18, 2026 · +514−37 · base 0c2ee5884e03
Agent prompt
what a new run launched now would send
Scheduled workflows attach a completion callback whose request_id must match the scheduler’s BufferedStart entry. Today, after a workflow reset—especially a second/chained reset—that matching breaks: the reset/rebuild path re-associates start-event callbacks with a different request ID (the reset operation’s ID or a later run’s create request ID). HandleNexusCompletion then finds no BufferedStart and drops the completion, so the scheduler stays stuck showing the action as still running after the workflow has finished.
Fix the history reset/rebuild behavior so that:
1. Across one or more resets, the request ID tied to WorkflowExecutionStarted on the reset run remains the original start request ID from the first run (not the reset request ID or an intermediate create request ID).
2. For a schedule-started workflow that is reset twice and then completed (e.g. via signal), the schedule eventually shows that original action as COMPLETED under both HSM and CHASM callback modes.
3. If a second completion callback with a distinct request ID was attached to the running workflow before reset, the reset run still has both callbacks with distinct request IDs; the schedule still records completion for the original start; and the additional callback is still delivered.
Reproduce conceptually: create a schedule, trigger immediately, wait until the run is RUNNING and has a valid reset point, reset (optionally twice), complete the latest run, then confirm ListSchedules/visibility shows COMPLETED and that start request IDs were preserved across resets.
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_cff2754a711cd`). 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.