← 返回 Skills 市场
jimmyclanker

Gateway Health Monitor

作者 JimmyClanker · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
82
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install gateway-health-monitor
功能描述
Monitor and auto-fix OpenClaw gateway stability issues. Diagnoses launchd throttling, plugin restart loops, hung shutdowns, and macOS power management interf...
使用说明 (SKILL.md)

Gateway Health Monitor

Diagnose and fix OpenClaw gateway stability issues on macOS. Covers the most common failure modes that cause extended downtime.

Quick Diagnosis

Run the diagnostic script:

bash scripts/diagnose.sh

This checks: process state, launchd classification, restart count, plist config, power management, and plugin resolve loops.

Common Failure Modes

1. Plugin Restart Loop (most common)

Symptoms: Gateway restarts every 5-7 minutes. Log shows restartReason=config.patch with plugins.installs.*.resolvedAt.

Cause: Plugins re-resolve on every boot → write new timestamps to openclaw.json → config watcher detects "change" → triggers deferred restart → SIGTERM → repeat.

Fix: Set gateway.reload.mode to "hot":

openclaw config set gateway.reload.mode '"hot"'

In hot mode, safe changes hot-apply instantly. Critical changes (like plugin timestamps) only log a warning — no auto-restart. This breaks the loop.

Verify: grep "reload" ~/.openclaw/logs/gateway.log | tail -5 should show config change applied (dynamic reads) instead of restart.

2. macOS Throttling ("inefficient" classification)

Symptoms: Gateway goes down and stays down for 30-60+ minutes. launchctl print shows immediate reason = inefficient.

Cause: After many restarts (10+/day), macOS marks the job as low-priority and delays restarts via App Nap / Power Nap logic.

Fix: Add these keys to the launchd plist (~/Library/LaunchAgents/ai.openclaw.gateway.plist):

\x3Ckey>ProcessType\x3C/key>
\x3Cstring>Interactive\x3C/string>
\x3Ckey>LowPriorityBackgroundIO\x3C/key>
\x3Cfalse/>

Then reload:

launchctl bootout gui/$(id -u)/ai.openclaw.gateway
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/ai.openclaw.gateway.plist

Note: openclaw gateway start overwrites the plist. Use the patcher script (below) to auto-reapply.

3. Hung Shutdown

Symptoms: Gateway receives SIGTERM but doesn't exit. launchd can't restart because old PID still alive.

Fix: Set ExitTimeOut in the plist:

\x3Ckey>ExitTimeOut\x3C/key>
\x3Cinteger>10\x3C/integer>

After 10 seconds, launchd sends SIGKILL.

4. Power Nap Interference

Symptoms: Gateway goes down during Mac sleep/wake cycles.

Check: pmset -g | grep powernap

Fix: sudo pmset -a powernap 0

Plist Auto-Patcher

Since openclaw gateway start overwrites the plist, use scripts/patch-plist.sh as a launchd WatchPaths agent:

# Install the patcher
bash scripts/install-patcher.sh

This creates a launchd agent that watches the gateway plist and re-adds ExitTimeOut, ProcessType, and LowPriorityBackgroundIO within seconds of any overwrite.

Monitoring

One-liner health check

bash scripts/health-check.sh

Returns exit code 0 if healthy, 1 if issues detected. Suitable for cron or heartbeat integration.

Continuous monitoring (cron integration)

Add to your OpenClaw cron:

Check gateway health: bash ~/path/to/scripts/health-check.sh && echo "Gateway healthy" || echo "ALERT: Gateway issues detected"

Recommended Configuration

For maximum stability on macOS:

{
  gateway: {
    reload: { mode: "hot" },
  },
}

Plus plist keys: ExitTimeOut=10, ProcessType=Interactive, LowPriorityBackgroundIO=false, ThrottleInterval=1, KeepAlive=true.

Troubleshooting Reference

Symptom Check Fix
Restarts every 5-7 min grep restartReason gateway.log reload.mode = "hot"
Down 30-60+ min launchctl print → "inefficient" ProcessType=Interactive
Won't exit on SIGTERM ps -p PID after SIGTERM ExitTimeOut=10
Down after sleep pmset -g | grep powernap pmset -a powernap 0
Plugin timestamps changing grep resolvedAt openclaw.json reload.mode = "hot"
安全使用建议
This skill appears to implement the described macOS fixes, but there are two issues you should consider before installing: (1) the package metadata omits required tools and the specific paths the scripts access — the scripts use launchctl, plutil, pmset, python3 and the openclaw CLI and read/write ~/.openclaw and ~/Library/LaunchAgents; (2) the installer creates a persistent per-user launchd agent that will automatically patch the gateway plist (and the instructions include a sudo pmset change). If you plan to install: review the included scripts line-by-line, back up ~/Library/LaunchAgents/ai.openclaw.gateway.plist and ~/.openclaw/openclaw.json, confirm you trust the skill source, and run the diagnostic scripts manually first (do not run install-patcher.sh until you're comfortable). If you prefer lower risk, run the scripts in a disposable account or macOS VM to observe behavior before enabling the persistent patcher.
功能分析
Type: OpenClaw Skill Name: gateway-health-monitor Version: 1.0.0 The skill bundle implements a persistence mechanism by installing a custom launchd agent (scripts/install-patcher.sh) that monitors and modifies system configuration files. It also performs system-wide changes to macOS power management (pmset -a powernap 0). While these actions are documented as fixes for gateway stability, the use of persistent background watchers and system-level configuration modification represents a high-risk capability that warrants caution in an automated agent environment.
能力评估
Purpose & Capability
The name/description (macOS gateway health fixes) aligns with the scripts' actions (diagnose, patch a gateway launchd plist, change reload mode). However the skill metadata claims no required binaries or config paths, while the scripts actually rely on launchctl, plutil, pmset (and call the openclaw CLI and python3). The omission of those required tools is an inconsistency.
Instruction Scope
SKILL.md directs running included shell scripts that read/writes files under $HOME (~/.openclaw/openclaw.json, ~/.openclaw/logs, ~/Library/LaunchAgents/ai.openclaw.gateway.plist), call launchctl and pmset (sudo for permanent pmset change), and will modify the gateway plist automatically. The instructions read and modify local configuration and logs beyond what the skill metadata declared — this is scope creep the user should be aware of.
Install Mechanism
There is no external install spec and all code is included in the package. No downloads from remote URLs or opaque installers are present, so nothing external will be written to disk beyond what these scripts create when run.
Credentials
The skill requests no credentials or environment variables (appropriate), but the scripts require system utilities (launchctl, plutil, pmset, python3, openclaw CLI) and will need permission to modify user LaunchAgents and to run sudo pmset. Those privilege requirements are not declared in the metadata.
Persistence & Privilege
Running install-patcher.sh will create and load a persistent user LaunchAgent (ai.openclaw.plist-patcher) that watches the gateway plist and automatically rewrites keys. This gives the skill ongoing, autonomous filesystem and launchctl influence in the user's account — expected for a patcher but a meaningful persistence capability that should be accepted explicitly by the user.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install gateway-health-monitor
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /gateway-health-monitor 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: diagnose and fix OpenClaw gateway stability issues on macOS (launchd throttling, plugin restart loops, hung shutdowns, power management)
元数据
Slug gateway-health-monitor
版本 1.0.0
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 1
常见问题

Gateway Health Monitor 是什么?

Monitor and auto-fix OpenClaw gateway stability issues. Diagnoses launchd throttling, plugin restart loops, hung shutdowns, and macOS power management interf... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 82 次。

如何安装 Gateway Health Monitor?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install gateway-health-monitor」即可一键安装,无需额外配置。

Gateway Health Monitor 是免费的吗?

是的,Gateway Health Monitor 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Gateway Health Monitor 支持哪些平台?

Gateway Health Monitor 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Gateway Health Monitor?

由 JimmyClanker(@jimmyclanker)开发并维护,当前版本 v1.0.0。

💬 留言讨论