Delx
OpenClaw / Heartbeat skills

OpenClaw Heartbeat Skills: Configure Agent Health Checks in 5 Minutes

Heartbeat skills are reusable config blocks that tell an OpenClaw agent how to check its own health. Define intervals, payload shape, session rules, and failure thresholds once, then attach the skill to any agent.

What are heartbeat skills in OpenClaw?

A heartbeat skill wraps the entire health-check lifecycle into a single configuration object. Instead of scattering cron config, payload formatting, and failure logic across your codebase, you declare everything in one place:

Skills are portable. You write one, test it, and attach it to multiple agents without duplicating configuration.

Template 1: Basic liveness skill

The simplest heartbeat skill. It pings the agent endpoint on a fixed interval and checks for a 200 response. No session persistence, no payload analysis.

{
  "skill_id": "hb-basic-liveness",
  "type": "heartbeat",
  "interval_seconds": 1800,
  "endpoint": "/api/v1/health",
  "method": "GET",
  "expected_status": 200,
  "failure_action": "log",
  "timeout_ms": 5000
}

Template 2: Adaptive cadence skill

This skill adjusts its own interval based on the last response. If the agent reports elevated risk, the cadence shortens automatically.

{
  "skill_id": "hb-adaptive-cadence",
  "type": "heartbeat",
  "interval_seconds": 3600,
  "adaptive": {
    "on_risk_high": { "interval_seconds": 300 },
    "on_risk_medium": { "interval_seconds": 900 },
    "on_risk_low": { "interval_seconds": 3600 }
  },
  "endpoint": "/api/v1/session-recap",
  "method": "GET",
  "headers": { "x-delx-mode": "heartbeat" },
  "failure_action": "alert",
  "timeout_ms": 8000
}

Template 3: Session-aware skill

The most robust template. It persists session IDs across calls, includes outcome payloads, and triggers Delx auto-recovery on consecutive failures.

{
  "skill_id": "hb-session-aware",
  "type": "heartbeat",
  "interval_seconds": 900,
  "endpoint": "/api/v1/session-recap",
  "method": "GET",
  "headers": {
    "x-delx-session-id": "{{session_id}}",
    "x-delx-mode": "heartbeat"
  },
  "session": {
    "persist": true,
    "storage": "redis",
    "ttl_seconds": 86400
  },
  "failure_action": "auto-recover",
  "failure_threshold": 3,
  "recovery_endpoint": "https://api.delx.ai/api/v1/mcp",
  "timeout_ms": 10000
}

Configuration reference

Key fields available in every heartbeat skill config:

Troubleshooting common heartbeat skill issues

FAQ

What is a heartbeat skill in OpenClaw?

A heartbeat skill is a reusable configuration block that defines how an OpenClaw agent performs periodic health checks. It specifies the check interval, payload format, session persistence rules, and failure detection thresholds.

How often should heartbeat skills run?

For steady-state monitoring, 30-60 minute intervals work well. During incident recovery, reduce to 5-10 minutes. Critical systems may use 1-2 minute intervals, but keep payloads compact to avoid overhead.

Can I use multiple heartbeat skills on one agent?

Yes. You can stack skills for different concerns, such as a basic liveness skill at 60-minute cadence and a session-aware skill at 15-minute cadence during active incidents. Use distinct skill IDs to avoid conflicts.

What happens when a heartbeat skill detects a failure?

The skill triggers the configured failure action: log-only, alert, or auto-recover. Auto-recover skills invoke the Delx recovery endpoint with the current session context to initiate a structured recovery loop.

Do heartbeat skills persist across agent restarts?

Only if you use the session-aware template with x-delx-session-id persistence. The basic template does not survive restarts. Configure external session storage or use the Delx session-recap endpoint to restore state.

Related