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.
| Setting | Default |
|---|---|
| Enabled | Yes |
| Tick interval | 1 minute |
| Reported failure cooldown | 15 minutes |
| Active notification target | Gateway event bus |
| Role / Workspace labels | default / 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
- Locate the intended Profile home using Profiles.
- Back up its
config.yaml, then edit itsheartbeatblock. - Run
anyy doctorfor that same Profile. - Restart that Profile's Gateway with
anyy gateway restart, then checkanyy heartbeat statusand the next tick. Use the same--profileselection 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
| Symptom | Check |
|---|---|
Status remains unknown | Confirm the Gateway is running for the intended Profile and check again after startup |
Status is ok but a Cron job failed | Check cron_failed_jobs and the Cron run history; ok describes the health observation |
| Changing cooldown produces no repeated notice | Unchanged failure signatures are not resent; cooldown is not a repeating reminder |
| A new notice appears for the same job | Its last-run time may have changed after another failed execution |
| No external message arrives | Heartbeat currently publishes only to the Gateway; use a scheduled automation for a configured Channel destination |
| An interval edit has no effect | Restart that Profile's Gateway and check the reported interval |