gateway-auto-rollback
Automatic configuration rollback mechanism for OpenClaw Gateway. Provides three-layer protection: pre-modification backup, post-modification validation, and automatic rollback on failure. Includes a file watcher daemon, JSON validation, Gateway health checks, and SHA256 content-addressed backups. Use when modifying openclaw.json or other critical config files to prevent accidental breakage and ensure zero-downtime configuration changes.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/halfmoon82/gateway-auto-rollbackGateway Auto-Rollback
Three-layer configuration protection for OpenClaw Gateway — never break your config again.
What It Does
Automatically protects your OpenClaw configuration files with:
- Pre-modification backup — SHA256 content-addressed snapshots before any change
- Post-modification validation — JSON syntax check + Gateway health probe
- Automatic rollback — instant restore if validation fails
When to Use
- Before modifying
openclaw.json,exec-approvals.json, orskills.json - When running automated config changes (cron jobs, scripts)
- As a background safety net during development
- When you want peace of mind that a bad config won't take down your agent
Quick Start
One-shot check (before manual edits)
python3 gateway-auto-rollback.py
This initializes the backup directory, validates current config, and logs status.
Watch mode (background daemon)
python3 gateway-auto-rollback.py --watch &
Monitors critical config files every 3 minutes. Auto-exits after 3 consecutive healthy checks (config is stable).
How It Works
Before Modification During After Modification
↓ ↓ ↓
Backup + Hash ───→ Execute Change ───→ JSON Validate + Health Check
│ │
└──────────────────────────────────────→ Auto-rollback on failure
Protected Files
| File | Description |
|---|---|
openclaw.json | Main Gateway configuration |
exec-approvals.json | Command execution approvals |
skills.json | Skills registry |
Backup Naming
Backups are stored in ~/.openclaw/backup/ with content-addressed names:
openclaw.json.20260301_053612.a1b2c3d4.bak
↑ timestamp ↑ SHA256 prefix (dedup)
API Reference
Python Functions
from gateway_auto_rollback import (
pre_modification_check, # Call before modifying config
post_modification_verify, # Call after modifying config
create_backup, # Manual backup creation
validate_json, # JSON syntax validation
check_gateway_health, # Gateway health probe
rollback_to_backup, # Manual rollback
watch_config_files, # Start watch daemon
)
Pre-modification flow
from pathlib import Path
config = Path.home() / ".openclaw" / "openclaw.json"
# Returns backup path on success, False on failure
backup = pre_modification_check(config)
# ... make your changes ...
# Validates and auto-rolls back if needed
success = post_modification_verify(config, backup)
Watch mode details
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-halfmoon82-gateway-auto-rollback": {
"enabled": true,
"auto_update": true
}
}
}Related Skills
Skill Trigger V2
Skill by halfmoon82
Complex Task Methodology
Skill by halfmoon82
semantic-router
让 AI 代理根据对话内容自动选择最合适的模型。四层识别(系统过滤→关键词→指示词→语义相似度),四池架构(高速/智能/人文/代理),五分支路由,全自动 Fallback 回路。支持 trigger_groups_all 非连续词组命中。
subagent-isolation-guard
固化子代理物理隔离与语义路由旁路。防止跨代理上下文污染及由于语义路由导致的子代理切模/重置问题。
skill-safe-install
L0 级技能安全安装流程。触发“安装技能/安全安装/审查权限”时,强制执行 Step0-5(查重→检索→审查→沙箱→正式安装→白名单)。