360 Secure SkillHub
360 安全技能中心

Agent Defibrillator

该 Skill 提供 Agent Defibrillator:在 macOS 以 launchd 服务方式安装看门狗,每 10 分钟检查 OpenClaw 网关健康状态,检测崩溃或残留进程后按重试与冷却策略自动重启,可选 Discord 通知,并支持查看日志、停止/重启与卸载。

分类:自动化
hazy2go
hazy2go
热度 49.90
最近更新 2026-05-18 12:03:57

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add hazy2go/agent-defibrillator
兼容性
OpenClaw 专属
联网要求
需要联网
数据出网
可选出网
Metadata
name
agent-defibrillator
description
Watchdog that monitors your AI agent gateway and restarts it when it crashes. Triggers on "install defibrillator", "agent watchdog", "gateway monitor", "auto-restart agent", or "keep agent alive". macOS launchd service with optional Discord notifications.

Agent Defibrillator

Watchdog service that monitors your AI agent gateway and restarts it when it crashes.

What It Does

  • Checks gateway health every 10 minutes
  • Detects crashes and stale processes
  • Auto-restarts with cooldown protection
  • Optional Discord notifications on restart
  • Detects version mismatches after updates

Install

Recommended (review code first):

git clone https://github.com/hazy2go/agent-defibrillator.git
cd agent-defibrillator
./install.sh

Verify

launchctl list | grep defib

Configure

Edit ~/.openclaw/scripts/defibrillator.sh:

Variable Default Description
DEFIB_GATEWAY_LABEL ai.openclaw.gateway launchd service label
DEFIB_RETRY_DELAY 10 Seconds between retries
DEFIB_MAX_RETRIES 3 Retries before restart
DEFIB_COOLDOWN 300 Seconds between restarts
DISCORD_CHANNEL (empty) Your channel ID for notifications

Commands

# View logs
tail -f ~/.openclaw/logs/defibrillator.log

# Manual check
~/.openclaw/scripts/defibrillator.sh

# Stop watchdog
launchctl bootout gui/$(id -u)/com.openclaw.defibrillator

# Restart watchdog
launchctl kickstart -k gui/$(id -u)/com.openclaw.defibrillator

Uninstall

launchctl bootout gui/$(id -u)/com.openclaw.defibrillator
rm ~/Library/LaunchAgents/com.openclaw.defibrillator.plist
rm ~/.openclaw/scripts/defibrillator.sh

Requirements

  • macOS (uses launchd)
  • AI agent running via launchd (OpenClaw, etc.)