Expand description
Persistent cron scheduler for AgentMux.
Backs each enabled CronJob with a tokio task that sleeps until the
next scheduled fire time (computed from the 5-field UTC cron expression),
delivers the prompt as /agentmux/reactive/inject would — in process
since identity M4c-3 (see FireDelivery) — and records the fire in the
DB.
On startup, runs one catch-up fire for any job whose next scheduled time
after last_fired is already in the past (FIRE_ONCE_NOW misfire policy —
never replay all missed fires, never cause a cron storm).
See docs/specs/SPEC_CRON_LOOP_ROBUSTNESS_2026_06_25.md §3.2.
Structs§
Functions§
- fire_
target 🔒 - What a cron fire addresses: the UID when one was captured at creation,
else the name (counted, spec §9.2 —
cron.fire_by_namereaching zero is part of M5’s exit criterion). - is_
expired_ 🔒by_ age - True when a job’s hard age-expiry bound (
max_age_secs, seconds sincecreated_at) has been reached.None= no bound, never expires by age (the default for every job created before this field existed, and for any job that explicitly opts out). See docs/specs/SPEC_AGENT_POLLING_AND_WAKEUP_HARDENING_2026_08_04.md Phase 0. - should_
catchup 🔒 - Determine if a job needs a catch-up fire on startup.
Type Aliases§
- Fire
Delivery - In-process delivery of a fire: the server’s shared inject path
(
server::reactive::deliver, on the instance-key tier), given the job’s request and its creator’s UID. Identity M4c-3 (SPEC_AGENT_IDENTITY_CARRIED_NOT_DERIVED_2026_09_23.md §6.5.9): the scheduler is built beforeAppState, so the server installs this onceAppStateexists (CronScheduler::install_delivery), as it installs agent-turn delivery. Until then a fire POSTs to the route, as before. - Handle
Map 🔒 - Abort handles for every currently scheduled cron task.