openclaw/scripts
valtterimelkko dd7f826d0a Add PM2-native health monitoring and startup improvements
- Created scripts/gateway-start.sh: Startup wrapper that cleans stale lock files
  before starting the gateway (prevents "already running" errors)

- Created scripts/pm2-health-monitor.js: Standalone health check process managed by PM2
  * Monitors port 18789 connectivity every 5 minutes
  * Detects unresponsive gateway (process running but port hung)
  * Force-restarts via killall + PM2 auto-recovery
  * Monitors inotify watcher usage (warns at 80% of limit)
  * Logs to /tmp/moltbot/pm2-health-monitor.log

- Updated ecosystem.config.cjs to:
  * Use gateway-start.sh wrapper for lock cleanup
  * Add moltbot-health-monitor as separate PM2 app
  * Health monitor runs alongside gateway (same PM2 daemon, isolated from other daemons)

Key Design Principles:
- PM2 handles process lifecycle (restart, memory limits, crash recovery)
- Health monitor adds responsiveness detection (what PM2 can't do alone)
- No systemd involvement (prevents port conflicts with other PM2 instances)
- Each PM2 daemon isolated: moltbot-gateway, si_project/dashboard, ai_product_visualizer

This ensures gateway remains stable even if it becomes unresponsive to Telegram messages.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-01-29 20:03:06 +00:00
..
docker fix: stabilize install smoke against clawdbot installer 2026-01-27 14:58:01 +00:00
e2e update refs 2026-01-27 13:50:46 -08:00
pre-commit chore: stabilize prek hooks runner selection (#1720) (thanks @dguido) 2026-01-25 10:55:28 +00:00
repro fix: run cli scripts via node build runner 2026-01-18 18:43:39 +00:00
systemd refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00
auth-monitor.sh refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00
bench-model.ts Onboarding: add MiniMax hosted API key option 2026-01-09 13:39:28 +01:00
build_icon.sh refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00
build-and-run-mac.sh refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00
build-docs-list.mjs chore: switch repo scripts to node 2026-01-18 18:46:18 +00:00
bundle-a2ui.sh Mac: finish Moltbot rename 2026-01-27 14:12:17 -06:00
canvas-a2ui-copy.ts fix: allow docker builds to skip missing a2ui assets 2026-01-27 15:16:20 +00:00
changelog-to-html.sh refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00
check-ts-max-loc.ts refactor(src): split oversized modules 2026-01-14 01:17:56 +00:00
claude-auth-status.sh refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00
clawlog.sh Branding: update bot.molt bundle IDs + launchd labels 2026-01-27 14:46:50 -06:00
clawtributors-map.json Docs: update clawtributors list 2026-01-25 22:38:04 -06:00
codesign-mac-app.sh refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00
committer chore: block node_modules commits 2026-01-18 22:28:59 +00:00
copy-hook-metadata.ts feat: add internal hooks system 2026-01-17 01:31:57 +00:00
create-dmg.sh refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00
debug-claude-usage.ts refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00
docs-list.js fix: guard docs:list when docs dir missing 2026-01-18 22:53:39 +00:00
firecrawl-compare.ts feat: enhance web_fetch fallbacks 2026-01-17 00:00:49 +00:00
format-staged.js fix: add git hook setup and stable config hash sorting 2026-01-19 02:02:17 +00:00
gateway-start.sh Add PM2-native health monitoring and startup improvements 2026-01-29 20:03:06 +00:00
ios-team-id.sh chore(ios): add team id helper 2025-12-26 18:16:13 +01:00
make_appcast.sh refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00
mobile-reauth.sh refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00
notarize-mac-artifact.sh refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00
package-mac-app.sh Branding: update bot.molt bundle IDs + launchd labels 2026-01-27 14:46:50 -06:00
package-mac-dist.sh refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00
pm2-health-monitor.js Add PM2-native health monitoring and startup improvements 2026-01-29 20:03:06 +00:00
postinstall.js fix: add git hook setup and stable config hash sorting 2026-01-19 02:02:17 +00:00
protocol-gen-swift.ts Mac: finish Moltbot rename 2026-01-27 14:12:17 -06:00
protocol-gen.ts refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00
readability-basic-compare.ts feat: enhance web_fetch fallbacks 2026-01-17 00:00:49 +00:00
release-check.ts chore: prep 2026.1.27-beta.1 release 2026-01-28 01:35:58 +01:00
restart-mac.sh update refs 2026-01-27 13:50:46 -08:00
run-node.mjs update refs 2026-01-27 13:50:46 -08:00
sandbox-browser-entrypoint.sh refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00
sandbox-browser-setup.sh refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00
sandbox-common-setup.sh refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00
sandbox-setup.sh refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00
setup-auth-system.sh refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00
setup-git-hooks.js fix: add git hook setup and stable config hash sorting 2026-01-19 02:02:17 +00:00
sqlite-vec-smoke.mjs feat: add sqlite-vec memory search acceleration 2026-01-17 18:02:34 +00:00
sync-labels.ts CI: parse labeler without deps 2026-01-25 20:38:44 -06:00
sync-moonshot-docs.ts fix: sync Moonshot Kimi K2 models (#818) (thanks @mickahouan) 2026-01-13 03:19:49 +00:00
sync-plugin-versions.ts refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00
termux-auth-widget.sh refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00
termux-quick-auth.sh refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00
termux-sync-widget.sh refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00
test-cleanup-docker.sh refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00
test-force.ts refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00
test-install-sh-docker.sh refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00
test-install-sh-e2e-docker.sh refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00
test-live-gateway-models-docker.sh refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00
test-live-models-docker.sh refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00
test-parallel.mjs fix: ignore windows vitest worker crashes 2026-01-27 17:37:21 +00:00
ui.js fix: cover sync ui spawn on Windows (#1212) (thanks @longmaba) 2026-01-19 05:42:42 +00:00
update-clawtributors.ts refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00
update-clawtributors.types.ts feat: add prek pre-commit hooks and dependabot (#1720) 2026-01-25 10:53:23 +00:00
watch-node.mjs update refs 2026-01-27 13:50:46 -08:00
write-build-info.ts fix: stamp build commit metadata 2026-01-17 12:30:11 +00:00
zai-fallback-repro.ts refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00