Token导航 LogoToken导航TokenDH.com
开发只读clawhub未标认证来源可访问clear审计提醒

openclaw-safe-upgradeOpenClaw safe upgrade 安全

Agent Skill

openclaw-safe-upgrade 用于补充开发相关能力,适合在 OpenClaw 中需要让 Agent 承接开发相关任务时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

11,054

周安装

470

GitHub Stars

公开资料未说明

下载量

3,873
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:openclaw-safe-upgrade(OpenClaw safe upgrade 安全)
来源仓库:https://github.com/aliahmadaziz/openclaw-safe-upgrade
安装命令:
openclaw skills install openclaw-safe-upgrade
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install openclaw-safe-upgrade

简介

提供带即时回滚能力的 OpenClaw 安全升级方案。

  • 支持“升级 openclaw”、“检查更新”等自然语言指令触发。
  • 在升级失败时自动还原至前一可用版本保障服务连续性。
  • 需具备进程管理能力以控制 OpenClaw 主程序启停。
  • 推荐在低峰期执行,并提前通知相关方做好应急准备。openclaw-safe-upgrade 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

name
upgrade
description
Safe OpenClaw upgrade with instant rollback. Use when user says "upgrade openclaw", "update openclaw", "check for updates", or any request to upgrade/update the OpenClaw installation. NOT for config changes (use gateway config.patch). NOT for skill updates (use clawhub).

OpenClaw Safe Upgrade

Single atomic command. Auto-rollbacks on ANY failure. Survives the gateway restart it triggers.

Script

# From an agent session — ALWAYS set escape flag (ensures script survives gateway restart)
_UPGRADE_FORCE_ESCAPE=1 bash skills/upgrade/scripts/safe-upgrade.sh

# Force upgrade even if already on latest
_UPGRADE_FORCE_ESCAPE=1 bash skills/upgrade/scripts/safe-upgrade.sh --force

# Safe read-only checks (no escape needed)
bash skills/upgrade/scripts/safe-upgrade.sh --check      # Pre-flight only
bash skills/upgrade/scripts/safe-upgrade.sh --rollback    # Manual rollback

What Happens (one command, 10 steps)

  1. Cgroup escape: re-execs via systemd-run --user --scope so gateway stop can't kill the script
  2. Pre-flight: version check, disk space, breaking changes
  3. Backup: installation tarball, config, cron jobs, acpx customizations
  4. npm i -g openclaw@latest
  5. Restore acpx config (ACP agent customizations survive upgrades)
  6. Gateway restart (process-isolated: stop + start, survives script's own lifecycle)
  7. Wait for gateway health (configurable timeout) → auto-rollback if fails
  8. Wait for WhatsApp reconnect (non-fatal timeout)
  9. Verify: correct version + cron count preserved → auto-rollback if fails
  10. Record result → optional golden snapshot → cleanup backup

If ANY critical check fails, the script automatically rolls back — restores install, config, crons, and acpx. Trap handler catches unexpected exits during critical phases.

Agent Workflow

  1. Run --check first. Review output with the user.
  2. Inform user: "Launching upgrade — I'll go offline during gateway restart."
  3. Run the upgrade:
   _UPGRADE_FORCE_ESCAPE=1 bash skills/upgrade/scripts/safe-upgrade.sh

Do NOT pipe the output (no | tee, no 2>&1 | cat). The script writes to /tmp/upgrade-live.log.

  1. The current session will end when the gateway restarts. This is expected.
  2. After restart, the new session checks:

- ~/.openclaw/upgrade-result.json for status - /tmp/upgrade-live.log for live output - success: report to user, update any version references - rolled_back: tell user what went wrong (reason in result file) - No result file + backup at ~/.openclaw/upgrade-backups/current/: script was killed — run --rollback

  1. Full forensic log at ~/.openclaw/upgrade-last.log.

What Gets Backed Up

  • OpenClaw installation tarball
  • Config (openclaw.json)
  • Cron jobs (jobs.json)
  • acpx user config (~/.acpx/config.json) if present
  • Metadata (from/to version, timestamp, cron count)

Backup location: ~/.openclaw/upgrade-backups/current/

Result File

~/.openclaw/upgrade-result.json:

{
    "status": "success|rolled_back|rollback_failed|no_change|blocked",
    "from_version": "2026.3.2",
    "to_version": "2026.3.7",
    "message": "...",
    "timestamp": "...",
    "log": "~/.openclaw/upgrade-last.log"
}

Why Cgroup Escape?

OpenClaw runs as a systemd service. When an agent runs this script, the script is a child process inside the service's cgroup. systemctl stop sends SIGKILL to ALL processes in the cgroup — including the upgrade script. SIGKILL cannot be caught (no trap handler fires).

The script detects this and re-execs itself via systemd-run --user --scope into its own transient systemd scope. The parent process exits immediately — no pipes, no tee, no connections back to the gateway cgroup. This is why piping output is forbidden.

Important Notes

  • Never run gateway update.run directly — always use this script
  • Always set _UPGRADE_FORCE_ESCAPE=1 when running from an agent session
  • acpx customizations are auto-preserved across upgrades
  • Rollback restores the EXACT previous state: install + config + crons + acpx
  • --check is safe to run anytime, changes nothing
  • The script auto-detects gateway port from config (no hardcoded defaults)
  • Optional hooks: if golden-snapshot.sh or service-quick-check.py exist in your workspace, they're used; otherwise silently skipped

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

89.87%
按下载量换算3,481

安全审计

VirusTotal

可疑

ClawScan

可疑

Static analysis

未展示

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills