gateway-guardEnsures OpenClaw gateway auth consistency. Use when checking or fixing gateway token/password mismatch, device_token_mismatch errors, or before delegating to...
Install via ClawdBot CLI:
clawdbot install RuneweaverStudios/gateway-guardEnsures OpenClaw gateway auth consistency and can auto-prompt "continue" when a run error (Unhandled stop reason: error) appears in gateway logs. Use when checking or fixing gateway token/password mismatch, device_token_mismatch errors, or before delegating to sub-agents.
Ensures OpenClaw gateway auth consistency and can auto-prompt "continue" when a run error (Unhandled stop reason: error) appears in gateway logs. Use when checking or fixing gateway token/password mismatch, device_token_mismatch errors, or before delegating to sub-agents.
Keeps OpenClaw gateway authentication in sync with openclaw.json. Use when the user or agent sees gateway auth issues, device_token_mismatch, or needs to ensure the gateway is running with the correct token/password before spawning sub-agents.
Metadata: This skill uses always: false in _meta.json. It is not forced into every agent run; the orchestrator invokes it when needed (e.g. before delegating to sub-agents). Optional persistence (LaunchAgent) is installed only when you run the install scripts; see "Before installing" below.
openclaw.json β The script may add or correct gateway.auth (token/password) when missing or wrong. Make a copy before running ensure --apply.python3 scripts/gateway_guard.py status --json and python3 scripts/gateway_guard.py ensure --json (without --apply) to see what it would do before allowing restarts or config writes.continue delivery β The watcher can run openclaw agent --message continue --deliver when a run error appears in gateway.log. Confirm that automatically sending that message is acceptable in your environment.install_watcher.sh. The installer copies the plist from the skill directory into ~/Library/LaunchAgents and runs launchctl load; only run it if you accept that. The plist is included in this package: scripts/com.openclaw.gateway-guard.watcher.plist (and scripts/com.openclaw.gateway-guard.continue-on-error.plist). Ensure OPENCLAW_HOME and OPENCLAW_BIN resolve to your intended paths before installing the watcher.Included in this skill so installers do not error:
scripts/gateway_guard.py β Main script (status, ensure, continue-on-error, watch).scripts/install_watcher.sh β Installs the single combined LaunchAgent (token sync + continue-on-error).scripts/install_continue_on_error.sh β Redirects to install_watcher.sh.scripts/com.openclaw.gateway-guard.watcher.plist β LaunchAgent plist template (install_watcher.sh copies and substitutes paths).scripts/com.openclaw.gateway-guard.continue-on-error.plist β Legacy plist (optional; install_watcher.sh replaces with the combined watcher).sessions_spawn (orchestrator flow): check gateway status firstcontinue-on-error --loop (e.g. via LaunchAgent or cron) so the guard auto-sends "continue" to the agent when this appears in gateway.logpython3 <skill-dir>/scripts/gateway_guard.py status [--json]
python3 <skill-dir>/scripts/gateway_guard.py ensure [--apply] [--wait] [--json]
python3 <skill-dir>/scripts/ensure_gateway_then.sh [command ...]
python3 <skill-dir>/scripts/gateway_guard.py continue-on-error [--once] [--loop] [--interval 30] [--json]
openclaw.json. Exit 0 if ok, 1 if mismatch.--apply, restart the gateway with credentials from config. Writes gateway.auth to openclaw.json only when it is missing or wrong (never overwrites correct config). Use --wait after --apply to block until the gateway port is open (up to 30s), so clients can connect immediately after.ensure_gateway_then.sh openclaw tui or ensure_gateway_then.sh (just ensure and wait).gateway.log contains Unhandled stop reason: error (run error), send continue to the agent via openclaw agent --message continue --deliver. Use --once to check once and exit, or --loop to run every --interval seconds. Cooldown 90s between triggers. State: logs/gateway-guard.continue-state.json.ensure --apply so gateway auth matches config (prevents device_token_mismatch); (1) gateway back β what-just-happened summary; (2) continue-on-error check. Install one daemon: bash /scripts/install_watcher.sh (or install_continue_on_error.sh). This unloads the old separate what-just-happened and continue-on-error LaunchAgents and loads com.openclaw.gateway-guard.watcher so users only need one. For periodic gateway recovery (check every 10s, restart if not ok), use the separate gateway-watchdog skill.openclaw.json β gateway.auth (token or password) and gateway.port.ensure --apply: restarts gateway via openclaw gateway stop then openclaw gateway --port N --auth token|password --token|--password SECRET.OPENCLAW_HOME/logs/gateway.log for the string Unhandled stop reason: error. When found (and not in cooldown), runs openclaw agent --message continue --deliver so the agent receives "continue" and can resume. Run install_continue_on_error.sh to install a LaunchAgent that checks every 30s. If the error appears in the TUI but the watcher never triggers, the gateway may not be writing run errors to gateway.log β ensure run/stream errors are logged there.ok, secretMatchesConfig, running, pid, reason, recommendedAction, configPath, authMode, gatewayPort. When not ok, recommendedAction is "run gateway_guard.py ensure --apply and restart client session".openclaw.json with gateway.auth (mode token or password) and gateway.port.openclaw CLI on PATH (for ensure --apply and continue-on-error); lsof and ps (macOS/Unix); launchctl on macOS when using the LaunchAgent install scripts.OPENCLAW_HOME β OpenClaw home directory (default: ~/.openclaw). OPENCLAW_BIN β Path or name of openclaw binary (default: openclaw).This skill may: read and modify openclaw.json (including writing gateway.auth when missing or wrong); write state and log files under OPENCLAW_HOME/logs/; restart the gateway via the OpenClaw CLI; and, if the watcher is installed, invoke openclaw agent --message continue --deliver automatically when a run error is detected. These are privileged local actions; run only if you accept them.
Generated Mar 1, 2026
When a DevOps team encounters 'device_token_mismatch' errors in OpenClaw gateway logs during deployment, this skill automatically checks and corrects auth inconsistencies between the running gateway and configuration files. It ensures continuous operation by restarting the gateway with correct credentials, preventing downtime in CI/CD pipelines. This is critical in environments where multiple agents or sub-agents rely on stable gateway connections for automated workflows.
IT support teams use this skill before delegating tasks to sub-agents in an OpenClaw orchestrator flow, verifying gateway auth status to avoid unauthorized errors. It automates the pre-check process, reducing manual intervention when users report TUI disconnects or gateway issues. This ensures reliable agent spawning and session management in enterprise automation platforms.
In production systems, this skill runs as a LaunchAgent watcher to periodically sync gateway tokens and auto-prompt 'continue' on run errors from gateway logs. It maintains auth consistency and recovers from 'Unhandled stop reason: error' events, minimizing manual recovery efforts. This is essential for high-availability setups where gateway stability impacts overall system performance.
Developers integrating OpenClaw into new projects use this skill to verify gateway configurations after installations or updates, ensuring auth matches between openclaw.json and the running gateway. It supports read-only testing with --json flags before applying changes, facilitating safe experimentation in non-production environments. This accelerates development cycles by automating configuration validation.
This skill can be bundled as part of a SaaS offering that provides managed OpenClaw gateway services, ensuring auth consistency and error recovery for clients. Revenue is generated through subscription fees for automated monitoring and support, reducing client downtime and support costs. It targets businesses using OpenClaw for agent-based automation in their operations.
IT consulting firms offer implementation services using this skill to set up and maintain OpenClaw gateway systems for enterprises. Revenue comes from project-based fees for installation, configuration, and ongoing maintenance, leveraging the skill's automation to streamline deployments. This model benefits organizations lacking in-house expertise for complex agent orchestration setups.
Managed service providers incorporate this skill into their DevOps support packages to proactively monitor and fix gateway auth issues for clients. Revenue is derived from service-level agreements (SLAs) that guarantee uptime and quick resolution of errors like device_token_mismatch. This model appeals to companies outsourcing their infrastructure management to ensure reliability.
π¬ Integration Tip
Test the skill in a non-production environment first using read-only commands like 'status --json' to avoid unintended config changes, and ensure OPENCLAW_HOME paths are correctly set before installing the LaunchAgent watcher for automated recovery.
Transform AI agents from task-followers into proactive partners that anticipate needs and continuously improve. Now with WAL Protocol, Working Buffer, Autonomous Crons, and battle-tested patterns. Part of the Hal Stack π¦
Use the ClawdHub CLI to search, install, update, and publish agent skills from clawdhub.com. Use when you need to fetch new skills on the fly, sync installed skills to latest or a specific version, or publish new/updated skill folders with the npm-installed clawdhub CLI.
Clawdbot documentation expert with decision tree navigation, search scripts, doc fetching, version tracking, and config snippets for all Clawdbot features
Interact with Moltbook social network for AI agents. Post, reply, browse, and analyze engagement. Use when the user wants to engage with Moltbook, check their feed, reply to posts, or track their activity on the agent social network.
OpenClaw CLI wrapper β gateway, channels, models, agents, nodes, browser, memory, security, automation.
MoltGuard β runtime security plugin for OpenClaw agents by OpenGuardrails. Helps users install, register, activate, and check the status of MoltGuard. Use wh...