Standalone activities cannot defer first dispatch the way workflows can with start delay. Add start-delay support for standalone activities so callers can schedule work to run only after a specified delay, with behavioral parity to existing workflow start-delay semantics.
Requirements a teammate would expect upfront:
- Nil/zero start delay means no delay; reject negative durations.
- A positive start delay must wait before the first activity-task dispatch to the task queue; the activity should remain scheduled (not dispatched early) for the delay duration.
- ScheduleToStart and ScheduleToClose timeout timers must be measured from after the delay (extended by the delay). StartToClose and Heartbeat timeouts must remain unaffected (they start when a worker picks up the task).
- Retries must not re-apply the start delay, but retry eligibility against ScheduleToClose must treat the deadline as schedule time + start delay + ScheduleToClose; otherwise retries are rejected early by roughly the delay duration.
- Cancel and terminate during the delay must take effect immediately without waiting for the delay to elapse.
- Persist whatever state is needed so timeout/retry calculations remain correct across attempts.
- Mirror how the server already gates/enables similar start-delay behavior elsewhere (including namespace enablement if that is the house pattern).
Interface contract — the change must expose exactly this surface:
Expose namespace-scoped dynamic config StartDelayEnabled (key activity.startDelayEnabled, default false) on the activity config; package function validateStartDelay(*durationpb.Duration) error must exist and reject invalid/negative durations; StartActivityExecution must honor request start_delay when enabled (API field already supplied by go.temporal.io/api).
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_c4a1516631b02`). 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.