← Back to Skills Marketplace
jimmyclanker

Gateway Health Monitor

by JimmyClanker · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
82
Downloads
0
Stars
1
Active Installs
1
Versions
Install in OpenClaw
/install gateway-health-monitor
Description
Monitor and auto-fix OpenClaw gateway stability issues. Diagnoses launchd throttling, plugin restart loops, hung shutdowns, and macOS power management interf...
README (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"
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install gateway-health-monitor
  3. After installation, invoke the skill by name or use /gateway-health-monitor
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release: diagnose and fix OpenClaw gateway stability issues on macOS (launchd throttling, plugin restart loops, hung shutdowns, power management)
Metadata
Slug gateway-health-monitor
Version 1.0.0
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 1
Frequently Asked Questions

What is Gateway Health Monitor?

Monitor and auto-fix OpenClaw gateway stability issues. Diagnoses launchd throttling, plugin restart loops, hung shutdowns, and macOS power management interf... It is an AI Agent Skill for Claude Code / OpenClaw, with 82 downloads so far.

How do I install Gateway Health Monitor?

Run "/install gateway-health-monitor" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Gateway Health Monitor free?

Yes, Gateway Health Monitor is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Gateway Health Monitor support?

Gateway Health Monitor is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Gateway Health Monitor?

It is built and maintained by JimmyClanker (@jimmyclanker); the current version is v1.0.0.

💬 Comments