RescueClaw
简介
RescueClaw
原始描述
Provides automatic checkpoint creation and rollback to safely recover from failures during risky operations like config changes or updates.
通过你的 Agent 添加
安装目录:rescueclaw/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
技能正文
RescueClaw Skill
Provides checkpoint/rollback safety net for risky operations.
Before Risky Operations
Before modifying config, installing skills, or updating the gateway, create a checkpoint:
const rescueclaw = require('./rescueclaw-checkpoint');
await rescueclaw.createCheckpoint('About to apply config changes');
RescueClaw will take an immediate backup. If the agent goes unresponsive within the rollback window, it auto-restores.
After Successful Operations
Clear the checkpoint:
const rescueclaw = require('./rescueclaw-checkpoint');
await rescueclaw.clearCheckpoint();
Commands
The agent can also invoke RescueClaw CLI directly:
rescueclaw backup— manual snapshotrescueclaw status— check healthrescueclaw list— list backups
Installation
The daemon binary is bundled for supported platforms (linux/arm64). On install, it copies to ~/.local/bin/rescueclaw. For other platforms, download from GitHub Releases.
Data is stored in ~/.openclaw/rescueclaw/ (user-local, no sudo required).
API Reference
createCheckpoint(reason, rollbackWindowSec = 300)
createCheckpoint(reason, rollbackWindowSec = 300)Creates a checkpoint file that RescueClaw monitors. If the agent becomes unresponsive within the rollback window, RescueClaw will immediately restore from the checkpoint backup.
Parameters:
reason(string): Description of what operation is about to be performedrollbackWindowSec(number, optional): How many seconds to monitor for issues (default: 300)
Returns: Promise
clearCheckpoint()
Removes the checkpoint file, signaling that the risky operation completed successfully.
Returns: Promise
getStatus()
Gets RescueClaw daemon status by invoking the CLI.
Returns: Promise with health status details
Example: Safe Config Update
const fs = require('fs');
const rescueclaw = require('./rescueclaw-checkpoint');
async function updateConfig(newConfig) {
// Create safety checkpoint
await rescueclaw.createCheckpoint('Updating OpenClaw config', 180);
try {
// Perform the risky operation
fs.writeFileSync('~/.openclaw/openclaw.json', JSON.stringify(newConfig));
// Restart gateway
await exec('systemctl restart openclaw-gateway');
// If we get here, it worked!
await rescueclaw.clearCheckpoint();
console.log('✅ Config updated successfully');
} catch (err) {
console.error('❌ Config update failed:', err);
// Don't clear checkpoint - let RescueClaw auto-restore
}
}
const fs = require('fs');
const rescueclaw = require('./rescueclaw-checkpoint');
async function updateConfig(newConfig) {
// Create safety checkpoint
await rescueclaw.createCheckpoint('Updating OpenClaw config', 180);
try {
// Perform the risky operation
fs.writeFileSync('~/.openclaw/openclaw.json', JSON.stringify(newConfig));
// Restart gateway
await exec('systemctl restart openclaw-gateway');
// If we get here, it worked!
await rescueclaw.clearCheckpoint();
console.log('✅ Config updated successfully');
} catch (err) {
console.error('❌ Config update failed:', err);
// Don't clear checkpoint - let RescueClaw auto-restore
}
}
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。