Repository navigation
Description
Summary
PR #20152 repaired the automation cron parser (#15723, #15895, #15896, #16303). Both repairs are correct, but they change what already-saved user schedules mean, in both directions and with no user-visible signal:
5/15 * * * *goes from about 8,760 runs/year to 35,040 (1×/hour to 4×/hour). For agent-launching automations that is 4× the token spend and 4× the worktrees.0 9 */2 * 1goes from about 212 runs/year to 27 (7.9× fewer).0 9 */3 * 1goes 161 → 18.
The second direction is the dangerous one: an automation that quietly stops running most of the days it used to fails silently — nobody notices a job that did not fire. The first at least announces itself through spend.
That PR ships detection and a startup log, which is the minimum that makes either direction findable. This issue tracks the remaining half: a one-time, user-visible notice in the automations UI.
What already exists (use it)
src/shared/automation-schedule-drift.ts — describeAutomationScheduleDrift(schedule, anchor?) returns null when a saved cadence still means what it did, or { expression, previousRunsPerYear, currentRunsPerYear } when it drifted.
It is cheap: no second parser is kept. Pre-repair semantics are reproduced by rewriting a bare stepped term to its value (5/15 -> 5) and deriving the day-restriction flags from set cardinality, then re-using the current parser. Detection is a parse plus a 730-day day-match walk — a few thousand operations per automation, trivially affordable on startup or first render.
It deliberately compares what the schedule fires, not how it parsed. The restriction flags move on several expressions whose firing days do not change (0 9 * * 0-6, 0 9 */2 * *, 0 9 1-31 * *, 0 9 * * */2); reporting those would train the reader to ignore the notice. Classification is tested against behaviour recorded from the real pre-repair build, in src/shared/automation-schedule-drift.test.ts.
src/main/automations/schedule-drift-report.ts names each affected record once at startup:
[automations] 2 saved schedule(s) changed meaning when the cron parser was repaired; review them:
[automations] "Every 15 minutes from :05" (87ca135b-...) "5/15 * * * *" now runs more: about 35040/year, was about 8760/year
[automations] "Odd days and Mondays" (5dbee8dc-...) "0 9 */2 * 1" now runs fewer: about 27/year, was about 212/year
What is missing
A one-time, in-product notice. Suggested shape, smallest first:
- An inline badge or note on affected rows in the automations list — "this schedule's meaning changed in this release: now about X runs/year, was about Y" — dismissible, and shown once.
- Optionally the same note in the automation detail view.
Not a modal.
Why it was not done in PR #20152
Two costs that each deserve their own review, on a PR already carrying a dialect decision:
- Persistence. "One-time" needs a persisted flag. The right move is to reuse the existing pattern in
src/shared/persisted-ui-state-types.ts—dismissedUpdateVersion,dismissedUnexpectedSignoutVersion,dismissedUpdateNudgeId, which already encode "app version that last dismissed X; re-arms on each new version". AdismissedScheduleDriftVersionfits that shape exactly, but it is a persisted-UI-state schema addition. - i18n. User-visible copy goes through
translate()with generated catalog keys across 6 locales (en, es, fr, ja, ko, zh) plus thept-BRplugin catalog, generated byi18next-cli. Adding copy means a catalog regeneration and machine-generated placeholder translations — a noisy diff unrelated to a parser fix.
Acceptance
- An affected automation shows the notice once; dismissing it sticks across restarts and re-arms only on a later release.
- An unaffected automation never shows it — including the flag-moved-but-firing-unchanged expressions listed above.
- No modal, no blocking, and the automation keeps running either way.
Related
- PR fix(automations): isolate the scheduler tick and refuse oversized cron steps #20152 — the parser repair, the detector, and the startup log.
Activity
nwparker commentedon Sep 12, 2026
Closing as not planned for now. The behaviour change is already surfaced: #20152 emits a startup report naming each affected automation with its old and new firing frequency, which covers the safety need. The in-UI one-time notice remains a nice-to-have rather than a requirement, and the detector (
describeAutomationScheduleDrift) is in the codebase if anyone wants to build on it later.nwparker commentedon Sep 12, 2026
Not reopening — the call to treat the in-UI notice as a nice-to-have is reasonable. But the reasoning above is now misattributed, so recording the correction:
The cron work has since been split. #20152 no longer contains the drift detector or the startup report, and no longer changes any existing schedule's behaviour at all — it is now only tick isolation (#16303) and the oversized-step input gate (#15895), verified as 34/34 expressions firing identically to
main.The behaviour change,
describeAutomationScheduleDrift, and the startup report all moved to #20202, which is held pending an owner decision. So the safety net this close relies on ships with #20202, not #20152 — and if #20202 is never merged, there is no behaviour change to notice about, which is also fine.Worth reopening only if #20202 merges and the startup log is judged too weak a signal on its own.