Auto-Rollback
Use this skill before editing ~/.openclaw/openclaw.json.
It creates a timestamped backup, schedules a rollback job for 10 minutes later, and restores the backup if Gateway still cannot come up. Rollback auto-cancellation is available only if the workspace BOOT.md includes the bundled snippet from this skill and the boot-md hook is already installed.
Quick Flow
- 1. Run INLINECODE3
- Edit INLINECODE4
- Restart Gateway
- If Gateway becomes healthy,
BOOT.md cancels the rollback - If Gateway stays unhealthy, launchd executes the rollback script
Commands
Start protection
CODEBLOCK0
Short form also works:
CODEBLOCK1
Cancel pending rollback
CODEBLOCK2
Inspect current state
CODEBLOCK3
BOOT.md Integration
This skill does not install the boot-md hook by itself.
To enable automatic cancellation after a healthy restart:
- 1. Ensure your OpenClaw workspace already has the
boot-md hook installed. - Merge
skills/auto-rollback/BOOT.md into the workspace root BOOT.md.
Without that integration, rollback still works, but you must cancel it manually after a successful restart.
Files
- - Script: INLINECODE10
- BOOT snippet: INLINECODE11
- Backups: INLINECODE12
- State: INLINECODE13
- Log: INLINECODE14
- launchd plist: INLINECODE15
Agent Rule
If you want agents to always use this safety net, add an SOP rule in AGENTS.md that any openclaw.json change must run start first.
自动回滚
在编辑 ~/.openclaw/openclaw.json 之前,请先使用此技能。
它会创建一个带时间戳的备份,安排一个10分钟后执行的回滚任务,并在网关仍无法启动时恢复备份。仅当工作区 BOOT.md 包含此技能的内置代码片段且 boot-md 钩子已安装时,回滚自动取消功能才可用。
快速流程
- 1. 运行 skills/auto-rollback/auto-rollback.sh start --reason 变更内容
- 编辑 ~/.openclaw/openclaw.json
- 重启网关
- 如果网关恢复正常,BOOT.md 会取消回滚
- 如果网关仍不正常,launchd 会执行回滚脚本
命令
启动保护
bash
skills/auto-rollback/auto-rollback.sh start --reason 更新网关绑定
也支持短格式:
bash
skills/auto-rollback/auto-rollback.sh start 更新网关绑定
取消待处理的回滚
bash
skills/auto-rollback/auto-rollback.sh cancel
查看当前状态
bash
skills/auto-rollback/auto-rollback.sh status
BOOT.md 集成
此技能不会自行安装 boot-md 钩子。
要在健康重启后启用自动取消功能:
- 1. 确保你的 OpenClaw 工作区已安装 boot-md 钩子。
- 将 skills/auto-rollback/BOOT.md 合并到工作区根目录的 BOOT.md 中。
如果没有此集成,回滚功能仍然有效,但成功重启后需要手动取消。
文件
- - 脚本:skills/auto-rollback/auto-rollback.sh
- BOOT 代码片段:skills/auto-rollback/BOOT.md
- 备份:~/.openclaw/openclaw.json.YYYYMMDD-HHMMSS
- 状态:~/.openclaw/state/rollback-pending.json
- 日志:~/.openclaw/logs/rollback.log
- launchd plist:~/.openclaw/ai.openclaw.rollback.plist
代理规则
如果你希望代理始终使用此安全网,请在 AGENTS.md 中添加一条 SOP 规则:任何对 openclaw.json 的修改都必须先运行 start。