Scheduler and heartbeats
A schedule runs an agent task automatically — once at a chosen instant, on a fixed interval, or on a cron expression. It uses the same model harness, capabilities, permissions, memory, syscall audit, and observability records as a user-triggered message.
Schedules are durable. Each one is a database row with a persisted next-fire time, an immutable revision history, and an occurrence log that records every firing decision — including fires that were skipped or cancelled rather than launched.
The Scheduler screen has two tabs: Schedules for standalone schedules you create, and Heartbeat for each agent’s managed heartbeat schedule.
Trigger kinds
Section titled “Trigger kinds”| Trigger | Purpose |
|---|---|
| Once | Fire a single time at a chosen date and time. |
| Interval | Fire after each fixed delay. The runtime minimum is one minute. |
| Cron | Fire on a calendar expression — daily, weekdays, weekly, monthly, or a custom expression — in a chosen IANA timezone. |
Cron triggers are timezone-aware: a wall-clock time that does not exist because of a daylight-saving gap fires once at the first valid instant, and an ambiguous wall-clock time still fires only once. Use Preview next runs in the schedule form to see the computed fire times before saving.
Event-driven triggers — reacting to webhooks, file changes, or agent signals — are not implemented.
Create a schedule
Section titled “Create a schedule”- Open Scheduler → Schedules.
- Select New schedule.
- Choose the agent and give the schedule a name.
- Pick a trigger and, for cron, a timezone.
- Write a self-contained task prompt.
- Choose the missed-run, overlap, and failure policies.
- Optionally pre-approve approval-gated capabilities and set a per-run cost ceiling.
- Leave Enabled on and save.
Saving an existing schedule writes a new immutable revision. An in-flight occurrence keeps the revision it was launched with, so an edit never mutates work already running.
From a schedule’s row you can pause or resume it, run it immediately, open its occurrence history, edit it, duplicate it as a new disabled schedule, or archive it. Archived schedules can be restored — they come back paused — or deleted permanently, which also removes their revisions and history.
Policies
Section titled “Policies”Missed occurrences — while paused or stopped
Section titled “Missed occurrences — while paused or stopped”When the gateway starts or a paused schedule resumes, the sweep compares the persisted next-fire time with the present and applies the missed-run policy:
| Policy | Behavior |
|---|---|
skip |
Record one skipped occurrence noting how many instants passed, then continue from the next fresh instant. |
run_once |
Queue a single occurrence for the latest missed instant; earlier misses are noted as skipped. |
catch_up |
Queue every missed instant, capped at 25 occurrences per sweep. |
Overlapping runs — a fire arrives while one is still active
Section titled “Overlapping runs — a fire arrives while one is still active”| Policy | Behavior |
|---|---|
skip |
Record the instant as skipped-overlap and launch nothing. |
queue |
Queue the occurrence; it launches after the running one finishes. |
cancel_previous |
Stop the in-flight run and fire the new instant. |
allow_parallel |
Let the new occurrence run alongside the active one. |
Failures
Section titled “Failures”| Policy | Behavior |
|---|---|
no_retry |
Record the failure and wait for the next scheduled instant. |
bounded_retry |
Queue a retry occurrence after a backoff that grows with each attempt, up to the configured attempt count. |
A retry is a new occurrence linked to the one that failed — it appears in the occurrence history as its own row, not a silent re-run. Occurrence statuses cover the full decision record: queued, running, completed, failed, skipped_missed, skipped_overlap, and cancelled.
Heartbeats
Section titled “Heartbeats”An agent heartbeat is the same engine behind a simpler interface. The heartbeat fields on the agent — task prompt, interval in minutes, cost ceiling, consecutive-failure threshold — project onto a managed schedule row, so the existing heartbeat configuration keeps working unchanged.
Managed heartbeat rows appear on the Heartbeat tab. They cannot be edited or deleted from the schedules surface; change them through the agent’s heartbeat configuration, which writes a new schedule revision. Run now on a heartbeat still executes the task immediately without disturbing the next periodic fire.
Write a safe task prompt
Section titled “Write a safe task prompt”A scheduled run has no new user message from which to infer intent. Make its prompt self-contained:
Review the shared workspace status file. Summarize blocked items and staletimestamps. Do not edit files or contact external services. If the file ismissing, report that as the result.For a connected service:
Check the project tracker for issues assigned to me that changed since thelast run. Write a concise summary. Do not create, update, or close issues.State what to inspect, what result to produce, and which actions are forbidden. Avoid broad prompts such as “take care of anything important.”
Execution behavior
Section titled “Execution behavior”When a fire instant arrives, CaberOS:
- Loads the schedule’s current revision.
- Applies the overlap policy if an earlier occurrence is still open.
- Records an occurrence and creates a run with trigger
schedule— orheartbeatfor managed schedules — with its own session. - Sends the task prompt through the normal pipeline.
- Applies the schedule’s cost ceiling and normal turn/context limits.
- Mediates every capability call.
- Updates the occurrence, last-fire, status, error, next-fire, and consecutive-failure state.
The result appears in the agent’s history and in Observability, linked from the occurrence. Spend reports can separate scheduled and user-message triggers.
Permissions and approvals
Section titled “Permissions and approvals”A scheduled run does not receive broader authority than the agent:
- Not-permitted capabilities remain unavailable.
- On-demand capabilities still require discovery and loading.
- MCP servers still need to be connected and bound.
- Sandbox rules still apply.
- Calls still produce audit records.
Be careful with capabilities that require an operator. An unattended run may pause waiting for approval or be denied according to its channel policy. The schedule form can pre-approve specific approval-gated capabilities for that schedule only — pre-approval skips the prompt inside the agent’s existing ceiling and never widens it. For autonomous read-only checks, grant only the required read operations and test the behavior with Run now.
Run now
Section titled “Run now”Run now materializes an ad-hoc occurrence and executes it immediately without changing the persisted next-fire time. It requires a non-empty task prompt.
Use it to verify:
- the model and provider are available;
- the prompt is self-contained;
- the needed capabilities are permitted;
- approvals behave as expected;
- cost and turn limits are adequate;
- the result appears in the correct conversation and trace.
Failure tracking and notifications
Section titled “Failure tracking and notifications”The consecutive-failure counter lives on the schedule row, so it survives restarts. A completed run resets it; a failed, stopped, or exceptional run increments it.
When the configured threshold is reached, the dashboard shows an alert and creates a notification naming the agent, the failure count, the threshold, and the latest error. Heartbeats use the threshold from the agent configuration; other schedules alert on the first failure, deduplicated to one notification per schedule per day while the failure persists. A completed user-schedule occurrence can also send a completion notification that links to the session it produced.
Clearing an alert removes the visible alert but does not fix the underlying task. Let the schedule run successfully to reset the failure state.
Cost control
Section titled “Cost control”A schedule can set its own per-run cost ceiling — max_cost_per_heartbeat on a heartbeat — rather than using the normal user-message ceiling. Start with a small value and inspect actual spend.
Provider cost metadata may be absent or approximate. Combine the CaberOS limit with provider-side quotas or billing alerts for workloads where strict financial control is required.
Availability
Section titled “Availability”Schedules fire only while:
- the machine is awake;
- the CaberOS gateway process is running;
- the agent and the schedule are enabled;
- the task prompt is not blank;
- the configured model and required integrations are available.
This is not a distributed scheduler — no second node takes over firing. What the persisted state does give you is recovery: a gap while the gateway was down is handled by the missed-run policy on restart, and an occurrence that was running when the process died is reconciled to cancelled on the next start rather than left looking alive.
Troubleshooting
Section titled “Troubleshooting”A schedule never fires
Section titled “A schedule never fires”Confirm the schedule and its agent are enabled, the task prompt is non-empty, and the trigger produced a next-fire time — the detail view shows it. Intervals enforce a one-minute minimum.
Run now says the configuration is invalid
Section titled “Run now says the configuration is invalid”The schedule may have no revision, or its task prompt may be empty.
A scheduled run waits indefinitely
Section titled “A scheduled run waits indefinitely”Look for a pending approval. Pre-approve the capability on that schedule or adjust the approval policy only after reviewing the requested operation.
Consecutive failures keep increasing
Section titled “Consecutive failures keep increasing”Open the latest occurrence’s run in Observability. Check provider errors, denied syscalls, disconnected MCP servers, context limits, and cost limits.
No run occurred while the machine was asleep
Section titled “No run occurred while the machine was asleep”That is expected — firing requires a running gateway. Check the occurrence history after the next start: the missed-run policy decides whether the gap was recorded as skipped_missed, collapsed into a single run_once catch-up, or replayed per instant by catch_up. Change the policy if the schedule should work through missed instants rather than record them.