Skip to main content
What it does: Lets agents create automated tasks that run on a schedule — daily briefings, periodic health checks, end-of-day summaries, weekly reports. Who it’s for: Anyone who wants their agent to wake up on a fixed cadence (or at a specific moment in time) without being prompted. The cron tool covers user-defined jobs; heartbeat_manage covers the agent’s own internal periodic check-in.

cron — Scheduled Jobs

The cron tool manages scheduled jobs with 8 actions (add, list, update, remove, status, runs, run, wake) and 3 schedule types (cron, every, at). Jobs are persisted in ~/.comis/data.db (SQLite) so they survive daemon restarts — on startup the scheduler replays missed firings and resumes future schedules. Agents can create, update, monitor, and remove jobs from within a conversation. Each cron job runs with its own tool policy — the cron-minimal profile is the default, restricting the job to a safe subset (web_search, message, read/write file, list_dir, memory_store/search, cron, discover). Override per job to give a scheduled agent more or fewer tools.

Schedule Types

Use cron for recurring jobs on a fixed schedule (like “every weekday at 9am”). Use every for repeating intervals specified in milliseconds. Use at for one-time tasks at a specific moment.

Actions

Creates a new cron job with a specified schedule and payload.Parameters:Example — Daily 9am briefing:
Example — One-time reminder:
Example — Periodic system event every 30 minutes:
Lists all scheduled jobs with their names, schedules, and current status.Parameters:Returns a list of all jobs including their name, schedule type, expression, and whether they are active or paused.
Modifies an existing scheduled job. You can change the name or enable/disable the job.Parameters:Example — Disable a job:
Permanently deletes a scheduled job. This is a destructive action requiring user confirmation.Parameters:
Shows the current status of the scheduler, including overall health information.Parameters:Returns the scheduler’s health status, active job count, and overall state.
Shows recent execution history for a job, including success/failure status and timestamps.Parameters:
Immediately triggers a scheduled job, regardless of its schedule. Useful for testing or one-off execution.Parameters:
Wakes the scheduler after a daemon restart. This is primarily used internally to ensure the scheduler picks up any jobs that were due while the daemon was stopped.Parameters:

Wake-Gate — Run the Model Only When It Matters

A scheduled job may carry an optional wake-gate: a small pre-run script that runs before the job’s payload and decides whether to invoke the model at all. It is the efficiency layer for a polling job — a monitor that fires every few minutes usually finds nothing changed, and a wake-gate lets it answer “nothing to do” without spending a model turn. The gate runs in the same jailed sandbox an autonomous orchestrate script uses, under the agent’s own resolved capabilities — it can web_fetch, read, grep, and the other tools the agent already holds, but grants no new reach. It carries three fields: An agent attaches a gate when it creates or edits a job — pass the gate source as wake_gate_script (and optionally wake_gate_language, js or ts) to the cron tool’s add or update action. Only the script and language are authorable this way: a gate created through the cron tool or the web editor always uses the 30-second default timeoutSeconds — the field is not exposed as a tool or editor parameter.

The verdict protocol

The gate decides by what it prints. Its last non-empty line of stdout is read as the verdict: The sentinel match is case-insensitive. Both context and deliver are bounded (roughly the last 4,000 characters) so a gate injects a content-light finding rather than an unbounded script dump, and a delivered status is scrubbed for secrets before it reaches the channel.
The gate is fail-open. A gate that crashes, exits non-zero, times out, over-caps its output, or prints no parseable verdict wakes the model — a broken monitor is never silently dropped. Only an explicit {"wake": false} (or a silent sentinel) on the last line skips a fire. If the host cannot build the sandbox, or the agent’s autonomy is disabled, the job simply runs as it would without a gate.

Example — skip the model when the queue is empty

A gate that checks a build queue and only wakes the agent when something is waiting:
On an empty queue the fire costs one sandboxed HTTP call and zero model turns; only a non-empty queue pays for a model turn, and that turn starts with the pending list already in hand.
A wake-gate is not the wake action. The cron tool’s wake action (and the scheduler.wake RPC) is a restart-replay — it nudges the scheduler to pick up firings missed while the daemon was down. A wake-gate is a per-job pre-run decision about a single fire. They share a word and nothing else.
Every gated fire is observable without exposing what the gate gathered: a skipped fire is recorded in the job’s run history (runs shows it with a skipped status and the avoided-turn count), and the daemon-wide skip-rate, turns-saved, and gate tool-call cost roll up into the fleet health report. See the operations scheduler guide for the operator view.

heartbeat_manage — Agent Heartbeat

The heartbeat_manage tool controls the agent’s periodic heartbeat — a built-in scheduled event that fires on its own clock (separate from cron jobs). The heartbeat runs with the heartbeat-minimal tool policy by default (just message, memory_store, memory_search, discover) and is intended for lightweight check-ins. Heartbeat semantics:
  • The agent runs its heartbeat prompt every interval_ms (millisecond resolution).
  • Output is filtered before delivery: a special HEARTBEAT_OK token signals “all good” and is silently dropped, so users only see something when there is actually something to report.
  • light_context: true boots the heartbeat with just HEARTBEAT.md in scope, keeping context tiny.
  • Alert thresholds (alert_threshold, alert_cooldown_ms) let the agent escalate after N consecutive failures while avoiding alert spam.
  • Stale detection (stale_ms) flags an agent whose heartbeats stop landing.

Actions

Returns the current heartbeat settings (per-agent and effective config), including the interval and the prompt that runs on each beat.Parameters:
Updates the heartbeat configuration. Pass only the fields you want to change.Parameters:Example — Check for new emails every 5 minutes:
Shows runtime heartbeat state across all agents, including last fire time and next scheduled fire.Parameters:
Immediately fires the heartbeat for an agent, running the configured prompt right now.Parameters:

End-to-end example: daily research summary

A common workflow is to have an agent run an autonomous research pass every weekday morning and post the findings to a Discord channel. You can set this up entirely in chat — the agent calls cron once and the daemon handles the rest:
The agent translates that into a single cron add call:
What happens next:
  1. The cron entry persists in ~/.comis/data.db immediately.
  2. At 9:00 ET each weekday the scheduler enqueues an agent turn with the configured payload.
  3. The agent runs against the cron-minimal tool policy by default — enough to call web_search and message.
  4. Output lands in #ai-news as a normal Discord message; the runs action shows the per-execution log.
Use cron action: runs name: ai-news-daily-summary limit: 5 to inspect recent executions, or cron action: run name: ai-news-daily-summary to fire it immediately for a sanity check.

Failure modes

  • Invalid cron expression — the add action validates the expression up front and returns a structured error before persisting anything.
  • Missed firings during downtime — on daemon restart, the wake action replays any jobs whose schedule_at or cron tick was missed while the daemon was offline.
  • Agent turn errors — failures are logged with errorKind in the run history; alerts fire when alert_threshold consecutive failures occur within alert_cooldown_ms.
  • Heartbeat suppression — a heartbeat that returns HEARTBEAT_OK is silenced before delivery, so users only see meaningful pings.

Operations Scheduler

Server-side scheduler configuration and monitoring

Agent Tools Overview

Master reference table of all tools

Messaging

Send, reply, react, edit, and delete messages

Sessions

Sub-agents, pipelines, and session management