Skip to content

Automations: several times a day (random times or fixed interval) - #120

Merged
danielehrhardt merged 2 commits into
mainfrom
feat/automation-multiple-runs
Oct 9, 2026
Merged

danielehrhardt merged 2 commits into
mainfrom
feat/automation-multiple-runs

Conversation

@danielehrhardt

@danielehrhardt danielehrhardt commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Automations can now run several times a day, like a heartbeat.

Random times – e.g. 5 times a day between 08:00 and 22:00. New schedule trigger field runsPerWindow (2–24): the start window is split into equal parts and each part gets one random start, drawn per routine and part (same hash scheme as the existing start window, so restarts and edits keep the drawn times). Runs are spread across the day and never pile up. Stored as cron "0 8 * * *" + startWindowMinutes: 840 + runsPerWindow: 5.

Fixed interval – e.g. every 2 hours from 08:00 to 20:00 on weekdays. This is a plain cron step (0 8-20/2 * * 1-5). The optional random start window still works on top.

Changes

  • core: nextRandomStart takes runs, the scheduler plans one job per part, validation (needs a start window, 10+ min per run, max 24), MCP routine_create/routine_update schema + summary, agent prompt explains both options
  • shared: runsPerWindow on the schedule trigger, max start window raised from 12 h to 24 h (still capped by the gap between runs)
  • desktop: new "Several times a day" repeat option with Random times / Fixed interval, runs per day or interval, time range, day picker, a 24 h timeline preview, and readable summaries everywhere ("5 times a day at random times between 8:00 AM and 10:00 PM", "Every 2 hours from 8:00 AM to 8:00 PM on weekdays")
  • tests for part slots, skipping handled parts and validation

Tested: core tests (1611 pass; the only failure is the folders.test that already fails on main), pnpm -r typecheck, and a sandbox run with screenshots of the list and the editor.

@danielehrhardt
danielehrhardt merged commit 670caec into main Oct 9, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant