| name | openclaw-restart |
| description | Restart OpenClaw gateway(s) — handles stow conflicts and verifies channels reconnect. Supports single-gateway and multi-gateway (per-tier) deployments. |
| argument-hint | [tier-name | all] |
| disable-model-invocation | true |
Restart OpenClaw Gateway
Restart the gateway with automatic stow conflict resolution. Argument $ARGUMENTS is the tier name to restart, or "all" to restart every tier. If empty, auto-detect deployment mode.
Setup Detection
OPENCLAW_REPO=$(readlink ~/.openclaw/openclaw.json 2>/dev/null | sed 's|/.openclaw/openclaw.json||')
TIER_CONFIGS=(~/.openclaw/configs/openclaw-*.json)
[[ -f "${TIER_CONFIGS[0]}" ]] && MULTI_GATEWAY=true || MULTI_GATEWAY=false
Steps
- Resolve stow conflicts:
rm -f ~/.openclaw/cron/jobs.json
The gateway overwrites jobs.json as a real file on every startup, breaking the stow symlink.
- Re-stow config:
cd "$OPENCLAW_REPO" && stow --no-folding -t ~ .
- Restart gateway(s):
Multi-gateway mode (MULTI_GATEWAY=true)
If $ARGUMENTS is a specific tier name:
launchctl kickstart -k gui/$(id -u)/ai.openclaw.gateway.$ARGUMENTS
If $ARGUMENTS is "all" or empty:
for cfg in ~/.openclaw/configs/openclaw-*.json; do
TIER=$(basename "$cfg" | sed 's/openclaw-//;s/.json//')
launchctl kickstart -k gui/$(id -u)/ai.openclaw.gateway.$TIER
done
Single-gateway mode (MULTI_GATEWAY=false)
launchctl kickstart -k gui/$(id -u)/ai.openclaw.gateway
- Wait for startup (5 seconds), then check logs:
Multi-gateway
sleep 5
for each restarted tier:
tail -30 ~/.openclaw-$TIER/gateway.log
Single-gateway
sleep 5 && tail -30 ~/.openclaw/logs/gateway.log
-
Verify channels connected:
- Look for
[telegram] [<agent>] starting provider lines (one per Telegram bot)
- Look for
[slack] socket mode connected lines
- Check if WhatsApp is starting or in restart loop
- Note the PID and port number
-
Report status to the user:
- Per tier (multi) or overall (single): PID, port, channel status
- Which Telegram bots started
- Slack connection status
- WhatsApp status (connected / restart loop / not configured)
- Any errors in the log