cron tool covers user-defined jobs; heartbeat_manage covers the agent’s own internal periodic check-in.
cron — Scheduled Jobs
Thecron 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
Actions
add -- Create a scheduled job
add -- Create a scheduled job
Creates a new cron job with a specified schedule and payload.Parameters:Example — One-time reminder:Example — Periodic system event every 30 minutes:
Example — Daily 9am briefing:
list -- List all scheduled jobs
list -- List all scheduled jobs
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.
update -- Update an existing job
update -- Update an existing job
Modifies an existing scheduled job. You can change the name or enable/disable the job.Parameters:
Example — Disable a job:
remove -- Delete a scheduled job
remove -- Delete a scheduled job
Permanently deletes a scheduled job. This is a destructive action requiring user confirmation.Parameters:
status -- Check scheduler status
status -- Check scheduler status
Shows the current status of the scheduler, including overall health information.Parameters:
Returns the scheduler’s health status, active job count, and overall state.
runs -- View recent run history
runs -- View recent run history
Shows recent execution history for a job, including success/failure status and timestamps.Parameters:
run -- Manually trigger a job
run -- Manually trigger a job
Immediately triggers a scheduled job, regardless of its schedule. Useful for testing or one-off execution.Parameters:
wake -- Wake the scheduler
wake -- Wake the scheduler
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 autonomousorchestrate 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.
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: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.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
Theheartbeat_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_OKtoken signals “all good” and is silently dropped, so users only see something when there is actually something to report. light_context: trueboots the heartbeat with justHEARTBEAT.mdin 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
get -- View heartbeat configuration
get -- View heartbeat configuration
Returns the current heartbeat settings (per-agent and effective config), including the interval and the prompt that runs on each beat.Parameters:
update -- Change heartbeat settings
update -- Change heartbeat settings
Updates the heartbeat configuration. Pass only the fields you want to change.Parameters:
Example — Check for new emails every 5 minutes:
status -- Check heartbeat status
status -- Check heartbeat status
Shows runtime heartbeat state across all agents, including last fire time and next scheduled fire.Parameters:
trigger -- Manually trigger a heartbeat
trigger -- Manually trigger a heartbeat
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 callscron once and the daemon handles the rest:
cron add call:
- The cron entry persists in
~/.comis/data.dbimmediately. - At 9:00 ET each weekday the scheduler enqueues an agent turn with the configured payload.
- The agent runs against the
cron-minimaltool policy by default — enough to callweb_searchandmessage. - Output lands in
#ai-newsas a normal Discord message; therunsaction shows the per-execution log.
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
addaction validates the expression up front and returns a structured error before persisting anything. - Missed firings during downtime — on daemon restart, the
wakeaction replays any jobs whoseschedule_ator cron tick was missed while the daemon was offline. - Agent turn errors — failures are logged with
errorKindin the run history; alerts fire whenalert_thresholdconsecutive failures occur withinalert_cooldown_ms. - Heartbeat suppression — a heartbeat that returns
HEARTBEAT_OKis silenced before delivery, so users only see meaningful pings.
Related
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
