Kills zombie Chrome so you don't have to
Browser automation is a resource leak waiting to happen. One stuck Puppeteer script, one Playwright session that died mid-run, one OpenClaw browser call that never closed — and Chrome keeps running. Forever. CPU climbs to 100% and stays there, quietly degrading everything else on the server until it falls over.
Chrome Watchdog is the circuit breaker. A cron job runs every 2 minutes and checks for orphaned Chrome processes. When it finds them — old enough, hot enough — it kills the whole tree and logs the event to syslog. Your server breathes again.
The thresholds are conservative by design: 3 minutes of age plus 40% combined CPU before any kill happens. Short-lived, legitimate browser sessions won't be touched. Only the stale ones — the ones that have been sitting there, spinning, doing nothing useful, for longer than any real automation task should take.
The renderer cap catches a different failure mode: runaway tab spawning. If Chrome is holding more than 4 renderer processes, the oldest ones are killed first, regardless of CPU. Memory fragmentation from unclosed tabs adds up fast.
Every kill is logged via logger -t openclaw-watchdog — visible in journalctl or /var/log/syslog. If you're seeing kills, that's signal: something in your automation layer isn't closing its sessions cleanly.
# 1. Unzip into your skills folder
unzip chrome-watchdog.zip -d ~/.openclaw/workspace/skills/
# 2. Install (run as root)
cd ~/.openclaw/workspace/skills/chrome-watchdog
sudo bash install.sh
# 3. Verify
crontab -l | grep watchdog
# 4. Watch for kills
journalctl -t openclaw-watchdog -f
Edit /usr/local/bin/openclaw-chrome-watchdog.sh to tune the thresholds for your environment:
MAX_RENDERERS=4 # Kill excess renderers above this count
CPU_THRESHOLD=40 # Combined CPU % before killing (integer)
AGE_THRESHOLD=180 # Process age in seconds before eligible for kill
Higher thresholds = more tolerant, less aggressive. Lower = tighter leash. Start with the defaults; adjust if you see false positives in the logs.
Unzip into ~/.openclaw/workspace/skills/ and run sudo bash install.sh.