A recurring agent job is useful only when its schedule, input, delivery target, and failure boundary are explicit. Hermes Cron provides that lifecycle, while a background terminal process or delegated child serves a different purpose.
- Use Cron for work that must survive the current chat session.
- Begin with local delivery and a paused job.
- Run once, inspect the output, then resume the schedule.
- Keep collection deterministic when an agent does not need to make a judgment.
1. Pick the right background mechanism
A delegated child is isolated but process-local. It can run alongside the parent, yet closing the owning session or restarting Hermes can cancel it. A terminal background process is suited to one bounded command. Cron stores a job definition and lets the Gateway or Desktop scheduler fire it later.
Choose Cron for daily reports, periodic monitoring, and repeated collection. Choose delegation for parallel reasoning that should return to the current parent. Choose a background terminal command for a build or migration that has a definite end.
2. Separate collection from judgment
The example reads a local RSS fixture, requires complete fields, sorts items by date, and emits stable text. This boundary is deliberate. A script can collect or normalize data; an LLM-driven Cron job can summarize it only when interpretation is needed.
Run the collector from the example directory:
python3 collect_news.py fixtures/feed.xml --limit 2
Expected output:
Hermes engineering briefing
- 2026-09-19 | Gateway reliability notes | https://example.invalid/gateway
- 2026-09-18 | Cron delivery patterns | https://example.invalid/cron
The fixture does not fetch the public internet. Replace it with a reviewed data source only after the local path behaves predictably.
3. Build a paused local plan
Generate a plan instead of creating a live schedule immediately:
python3 schedule_plan.py --output cron-plan.json
The plan records the exact argument vector for a weekday 09:00 job. It sets --deliver local, --paused, and --workdir, resolving the current example directory to an absolute path. An explicit work directory makes project context and relative paths predictable.
Hermes accepts intervals, five-field Cron expressions, relative one-shot durations, and ISO timestamps. A five-field expression uses the machine’s local timezone. Confirm the next run shown by hermes cron list instead of assuming the host timezone.
4. Create, inspect, and run once
A reviewed command has this shape:
hermes cron create "0 9 * * 1-5" "Run the local collector and return its output without adding claims." --name engineering-briefing --deliver local --workdir "$PWD" --paused
hermes cron list
hermes cron run <job_id>
--paused prevents the schedule from firing before inspection. hermes cron run requests an on-demand run. Read the local result and job state before enabling repetition.
Use --script with --no-agent when script stdout is already the complete result. In that mode Hermes skips the model, delivers non-empty stdout, and treats empty stdout as a silent tick. Keep scripts under the active Hermes home’s scripts directory, as required by the scheduler.
5. Resume and operate the lifecycle
After the manual run produces the intended text:
hermes cron resume <job_id>
hermes cron pause <job_id>
hermes cron remove <job_id>
Pause before changing a production input or prompt. Remove a job only when its history and definition are no longer needed. hermes cron runs and hermes cron doctor provide execution history and health checks in current releases.
Automatic firing needs an active Gateway or Desktop backend. A regular CLI conversation alone does not run the scheduler ticker. Local delivery is the safest first target because it avoids a second failure surface while the schedule is still being tuned.
6. Test failure boundaries
The fixture tests check date ordering, exact text output, invalid limits, and the local-only paused plan:
python3 -m unittest discover -s tests -v
An invalid limit fails before the feed is opened. That ordering matters in unattended work: reject unsafe parameters before touching an input, network, or delivery system.
For a real feed, add bounded network timeouts, schema checks, deduplication, and a stable output format. Do not include timestamps in monitor-script output unless every tick should look changed.
7. Know what this example does not prove
The example proves local collection and schedule construction. It does not create a job, start a Gateway, call a model, or deliver to Telegram. Those actions depend on the reader’s active profile and credentials.
Move to Telegram delivery only after local runs are stable. Chapter 9 adds a token-safe Gateway diagnostic and leaves the final Bot API exchange as an explicit credential-backed acceptance step.
Leave a Reply