Skip to main content

Heartbeat

Heartbeat is a lightweight, Gateway-owned health loop for one Profile. It records periodic health state and checks enabled Cron jobs for a failed last run. It does not run an assistant prompt or call the model on each tick.

What runs and when​

The Gateway records one tick at startup. When enabled, it continues at the configured interval; when disabled, it records disabled state and does not start the repeating loop. Heartbeat is separate from Cron and does not appear in its job list.

SettingDefault
EnabledYes
Tick interval1 minute
Reported failure cooldown15 minutes
Active notification targetGateway event bus
Role / Workspace labelsdefault / default

A healthy tick sends no message. Heartbeat compares failed jobs by job ID and last-run time. It reports a newly observed failure signature, including a new failed run of the same job, and does not repeat an unchanged failure simply because time passes.

In v0.1.107, failure_cooldown is loaded and shown in status, but the detector uses changed failure signatures. The field does not delay a newly changed failure or schedule repeated reminders for an unchanged one. Heartbeat scans enabled Cron jobs across the Profile; its Role/Workspace labels do not filter that scan.

Check status​

anyy heartbeat status
anyy heartbeat status --json

The result includes enabled state, status, interval, reported cooldown, Role, Workspace, delivery targets, count of failed Cron jobs, and last tick time. Use the selected Profile consistently, for example anyy --profile work heartbeat status.

Heartbeat also appears in:

anyy status
anyy doctor

ok means the tick completed its observation successfully; consult cron_failed_jobs for the failure count. It does not mean every Cron job succeeded. degraded indicates a scan or notification error.

Configure Heartbeat​

  1. Locate the intended Profile home using Profiles.
  2. Back up its config.yaml, then edit its heartbeat block.
  3. Run anyy doctor for that same Profile.
  4. Restart that Profile's Gateway with anyy gateway restart, then check anyy heartbeat status and the next tick. Use the same --profile selection for each command.
heartbeat:
enabled: true
tick_interval: 1m
failure_cooldown: 15m
delivery_targets:
- gateway
role_id: default
workspace_id: default

Use positive Go durations such as 30s or 5m for the interval. There is no public heartbeat set or manual heartbeat tick command. Configuration is read when the resident runtime starts, so restarting is how to apply an edited interval.

Notification delivery​

The current runtime sink handles only the gateway target. It publishes a Profile-level live event; there is no Channel adapter route or session association for this notice. Adding a platform name to delivery_targets does not configure a destination, and Heartbeat notices are not part of a conversation's saved system-notification history.

To investigate a notice, open Dashboard → Cron, inspect the named job and its run history, and correct the cause. Heartbeat observes failures; it does not retry or repair jobs. Ask Anyy to run the automation again, or wait for its next scheduled run, then verify the result.

Troubleshooting​

SymptomCheck
Status remains unknownConfirm the Gateway is running for the intended Profile and check again after startup
Status is ok but a Cron job failedCheck cron_failed_jobs and the Cron run history; ok describes the health observation
Changing cooldown produces no repeated noticeUnchanged failure signatures are not resent; cooldown is not a repeating reminder
A new notice appears for the same jobIts last-run time may have changed after another failed execution
No external message arrivesHeartbeat currently publishes only to the Gateway; use a scheduled automation for a configured Channel destination
An interval edit has no effectRestart that Profile's Gateway and check the reported interval