Skip to content

Add a watchdog for OpenClaw gateway recovery - #108

Merged
webup merged 1 commit into
developfrom
feat/gateway-watchdog
Apr 28, 2026
Merged

Add a watchdog for OpenClaw gateway recovery#108
webup merged 1 commit into
developfrom
feat/gateway-watchdog

Conversation

@webup

@webup webup commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

What

  • Start a ClawMaster-managed watchdog in service mode to monitor the OpenClaw gateway and restart it after unexpected downtime.
  • Add CLI visibility for the safeguard, including clawmaster serve help/startup output and clawmaster status reporting.
  • Surface watchdog state and restart counts in the Gateway UI with localized copy and test coverage.

Why

Users reported that the OpenClaw gateway can crash from time to time. ClawMaster should make the service mode more resilient and make that protection visible so users can tell the gateway is being monitored.

How

  • The backend service starts an opt-out watchdog when launched through clawmaster serve, probes gateway health, restarts it after unexpected downtime, and pauses after an intentional manual stop.
  • The CLI passes the watchdog env flag to the backend, documents --no-gateway-watchdog, and reads /api/gateway/status for status output.
  • The Gateway page renders safeguard availability, health state, and restart count using localized strings.

Testing

  • npm run test:cli
  • npm run test --workspace=@openclaw-manager/backend -- gatewayService.test.ts
  • npm run test --workspace=@openclaw-manager/web -- src/modules/gateway/__tests__/GatewayPage.test.tsx
  • npm run test --workspace=@openclaw-manager/web
  • npm run build:backend
  • npm run build
  • git diff --check
  • Browser Use walkthrough against http://127.0.0.1:17223/gateway, including diagnostics navigation and recovery after an induced gateway process stop.

Screenshots

Browser Use verified the Gateway UI locally: the page shows 守护: 自动重启已启用, 状态: 健康, and the restart count increasing after a simulated gateway crash. No screenshot asset is committed to the repository.

@webup
webup changed the base branch from main to develop April 28, 2026 06:14
@webup
webup merged commit 0c72d72 into develop Apr 28, 2026
38 of 40 checks passed
@webup webup linked an issue Apr 28, 2026 that may be closed by this pull request
@webup
webup deleted the feat/gateway-watchdog branch April 29, 2026 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reinforce OpenClaw gateway daemon reliability

1 participant