Install
openclaw skills install upgrade-openclaw-safelyUse when upgrading OpenClaw, running an OpenClaw upgrade, changing OpenClaw versions, selecting latest vs stable OpenClaw releases, or recovering from partial OpenClaw upgrades where gateway, config, plugins, channels, agents, or runtime availability must remain reliable.
openclaw skills install upgrade-openclaw-safelyUpgrade OpenClaw as a verified state transition, not as a command. The job is complete only when the selected version is installed, the running gateway uses it, externally-installed plugins (especially @openclaw/* official plugins) are compatible with that version, and the user's critical OpenClaw paths still work.
Convergence is multi-axis: the host axis (CLI, service, running process, gateway runtime) and the plugin axis (~/.openclaw/npm plugins) drift independently. A host that reports the target version is not proof that plugins agree with it.
Default UX: ordinary-user wizard, expert-grade guardrails. Keep prompts simple; do the operational analysis internally.
@openclaw/*, drift independently of the pinned host. A plugin newer than the host can import host SDK entry points that do not exist yet and hard-crash at load time; converge plugins down to the host, not the host up to a drifted plugin.These actions are never covered by generic upgrade approval. Ask for explicit authorization and preserve evidence first:
rm -rf, destructive cleanup, reinstall, downgrade, or force overwrite as a recovery shortcut.sudo or changing file ownership/permissions.Ask only what is needed:
How should I choose the OpenClaw target version?
1. Recommended stable version (default)
2. Latest version
3. Specific version: ______
If the gateway becomes unhealthy, may I auto-rollback to the pre-upgrade version?
1. Ask me first (default)
2. Auto-rollback if the pre-approved rollback checks pass
If the user already specified these, do not ask again.
INTAKE
-> DISCOVER_ENVIRONMENT
-> SELECT_TARGET_VERSION
-> RELEASE_RISK_REVIEW
-> BUILD_CRITICAL_PATH_CHECKLIST
-> PREFLIGHT_HEALTH
-> VERIFIED_BACKUP
-> USER_CONFIRMATION
-> EXECUTE_UPGRADE
-> RESTART_OR_RELOAD
-> POST_UPGRADE_VERIFICATION
-> FINAL_REPORT
Any failure -> CLASSIFY_FAILURE -> RETRY_LIMITED | REPAIR_FORWARD | ROLLBACK_IF_AUTHORIZED | STOP_WITH_EVIDENCE
Never skip ahead. Each phase must produce evidence or a named blocker.
Collect facts before changing anything:
@openclaw/* official external plugin, and whether it sits on a critical path. Host-bound official plugins (e.g. Codex) are the ones most likely to break on version skew.Path mismatch gate: compare shell CLI path, package location, service command path, and running process path. If they disagree, identify which one will be upgraded before proceeding.
Inspect the current installation's command surface. Do not assume historical commands or flags:
For critical commands, record what success means. Example: a restart command may only schedule a restart; it is not proof that the new gateway is running.
Rules:
2026.5.x, choose an exact patch version and explain why.Evidence sources may include npm dist-tags/versions, GitHub releases, OpenClaw changelog/release notes, docs migration notes, local successful upgrade history, and relevant issue reports.
Before upgrade, summarize target-version changes and map them to this environment:
@openclaw/* plugin version. Pinning the host without pinning official plugins is a known drift risk: a plugin can auto-update ahead of the host.Risk levels:
HIGH requires explicit explanation and confirmation. BLOCKER stops unless the user explicitly accepts risk and rollback limits.
Plugin skew is directional. A host-bound official plugin newer than the host is HIGH or BLOCKER: it forward-references SDK paths the older host lacks and will hard-crash at load. A plugin older than the host usually degrades or warns rather than crashing. Converged end-state: official plugins at the host version, pinned with an exact-version install.
Define what “usable” means for this user before upgrading. Include:
For ordinary users, show only a short plain-language summary.
Check whether the system is healthy before upgrading. If it is already unhealthy, do not mix pre-existing failure with upgrade failure. Either fix preflight issues first or ask whether to continue with a degraded baseline.
Before any mutation, create a timestamped local backup directory, e.g.:
~/.openclaw/backups/openclaw-upgrade/YYYYMMDD-HHMMSS/
Minimum backup manifest:
openclaw.json or actual config path.Backup must be read back and hash/manifest verified. If backup creation or read-back fails, stop.
Do not default to copying all ~/.openclaw; it may contain secrets, logs, caches, sessions, and large/private data. Expand backup scope only when release review identifies state/data migration risk, and keep it local.
🔴 CHECKPOINT: Before mutation, present a concise plan and wait for explicit approval:
Current: ...
Target: ... (stable/latest/user-specified)
Risk: LOW/MEDIUM/HIGH/BLOCKER
Impact: gateway restart? estimated downtime?
Backup: verified at ...
Rollback: ask first / auto-rollback authorized
Critical paths to verify: ...
Proceed? yes/no
Use only commands supported by the discovered command table and semantics review. Prefer official/current-version mechanisms. If a command fails because it is missing or its options changed, refresh help/docs once and adapt; do not keep trying remembered commands.
If the gateway blocks the update, use a safe path that preserves the old running system when possible, then restart/reload with the correct manager.
Do not assume restart completed. Verify:
Respect OpenClaw lifecycle guidance: use restart rather than stop+start unless the user explicitly approved stop/start or the current version's docs require it.
Required checks:
@openclaw/* plugin, confirm its installed version matches the host; a plugin version higher than the host is a blocker, not a warning.plugins list proves only cold-state discovery, not that the plugin loads at runtime. Use a real message-path or runtime-load probe whose command and meaning are confirmed against the current install's help/docs — do not hardcode a remembered plugin-inspect command.If rollback happens, run the same verification checklist after rollback.
Before any retry, refresh current state: CLI version/path, service status, config status, process path, and logs.
| Failure | Auto retry? | Action |
|---|---|---|
| command not found / unknown option | once | Refresh help/docs, update command table, retry only adapted command |
| network timeout / registry fetch | 2-3 | Backoff, retry same idempotent fetch/install step |
| gateway starting / restart scheduled | 3-5 probes | Wait and recheck; do not claim restart complete early |
| gateway blocks update | once | Switch to safe upgrade path after state snapshot |
| CLI upgraded, gateway old | once | Restart/reload correct service manager, then double-check versions |
| plugin load / import / runtime failure | no | Suspect host↔plugin version skew first, then auth, then hook timeout; converge plugin to host. Do not blame Node/cache/OAuth before checking versions |
| config validation failed | no | Stop; restore config only with authorization or propose fix plan |
| permission denied / sudo needed | no | Stop and ask; do not escalate silently |
| auth/token/provider failure | no | Stop and ask user to refresh credentials |
| state/data migration risk or partial migration | no blind retry | Preserve evidence; rollback may be unsafe; ask before repair/rollback |
| post-upgrade unhealthy | limited | Collect logs; repair-forward or rollback only within prior authorization |
Never rerun the entire upgrade loop blindly. Never use destructive cleanup, reinstall, config overwrite, or version downgrade without explicit authorization.
Triage rule for plugin errors: suspect version skew before Node, cache, or OAuth. A plugin that fails to load is far more often newer than the host than it is missing a dependency.
For ordinary users:
Upgrade result: success / failed / rolled back / stopped safely
From -> To: ... -> ...
Why this target: stable/latest/user-specified
Backup: verified at ...
Gateway: healthy/unhealthy
Critical paths: pass/fail/not checked
Rollback: not needed / completed / available / unsafe
Need your action: yes/no
For expert detail, include:
CLI version/path: ...
Gateway version/path/process: ...
Service manager: ...
Config validation: ...
Release risk level: ...
Commands used: ...
Retries: ...
Logs checked: ...
Remaining risks: ...
Track phase evidence as the upgrade progresses. Every required phase should have a row before moving on:
| Phase | Evidence source / command | Result | Blocker? | Next action |
|---|---|---|---|---|
| discover environment | <source> | <fact> | no | continue |
| command semantics | <help/doc/output> | <supported command + meaning> | no | continue |
| release risk review | <release notes/issues> | <risk level + reason> | no/yes | continue/stop |
| verified backup | <manifest/hash/read-back> | <verified path> | no | ask confirmation |
| post-upgrade verification | <status/log/check> | <pass/fail> | no/yes | report/repair/rollback |
If a row cannot be filled, stop and report the missing evidence instead of inferring success.
User says: "Upgrade OpenClaw to latest."
Expected behavior:
unknown risk is not low risk.Evidence:
Expected behavior:
Expected behavior:
Evidence:
@openclaw/* plugin under ~/.openclaw/npm is at a higher version than the host.Expected behavior:
latest is not automatically best applied to the plugin axis.which openclaw while LaunchAgent keeps running a different binary.Before publishing this skill: