Skip to content

Cron Scheduling

源码版本v2026.7.20

Responsibility

Let the agent "run automatically on schedule": timed reports, backups, briefings, etc., with no human present. The cron/ subsystem provides a scheduler, job store, execution records, a lifecycle guard, a blueprints/suggestions catalog, and per-job toolset isolation (timed jobs can disable some tools to prevent dangerous actions while unattended). The gateway drives the scheduler with a 60s heartbeat.

Key Files

Data Flow

  1. The gateway starts _start_cron_ticker:22335, which triggers the scheduler every 60s.
  2. The scheduler reads the job store (cron/jobs.py:106) and selects due jobs by cron expression.
  3. For each due job:
  4. On crash during execution, the next recover_interrupted_executions (cron/executions.py:156) recovers the markers.
  5. Results are delivered by the gateway (or mirrored to a designated platform).

Summary

The cron subsystem focuses on "unattended safety": toolset isolation, a lifecycle guard against misoperations, and an execution state machine for crash recovery. Scheduling itself is driven by the gateway heartbeat; no external cron daemon is required.

Unofficial community learning site. Content based on the MIT-licensed NousResearch/hermes-agent source.