Upgrade OpenClaw
Update, diff, audit, propose. Every new feature surfaced. Nothing missed.
Settings
On first run, check settings.json in this skill's directory. If subagentModel not set, ask:
"Which model for upgrade sub-agents? (e.g., claude-sonnet-4-6, deepseek-chat). Note: external providers will receive config data."
Save to settings.json:
CODEBLOCK0
Procedure
1. Record Pre-Update State
Before touching anything:
CODEBLOCK1
Save PRE_VERSION — needed for changelog diffing in Step 3.
2. Run Update
CODEBLOCK2
If dirty working tree, stash first:
CODEBLOCK3
Record new version:
CODEBLOCK4
If PRE_VERSION == POST_VERSION, report "Already up to date" and skip to Step 5 (audit only).
3. Extract Delta Changelog
The changelog lives locally at ~/openclaw/CHANGELOG.md after update. Versions delimited by ## YYYY.x.x headers.
Extract only entries between old and new version:
CODEBLOCK5
Then filter by relevance to this setup:
- 1. Read current config via
gateway config.get to identify enabled channels/plugins - From the changelog delta, keep entries matching:
- Enabled channels (e.g., Telegram — skip LINE/Discord/Feishu/etc. unless enabled)
- Core agent/gateway/cron/tools/memory/security changes (always relevant)
- ACP/sessions/subagent changes (if ACP enabled)
- Breaking changes (always relevant)
- 3. Discard entries for disabled channels, iOS/macOS app changes, and platforms not in use
- Categorize kept entries into: Features | Fixes | Security | Breaking Changes
4. Config Schema Gap Analysis
Fetch the live schema and current config:
- - Schema: INLINECODE10
- Current: INLINECODE11
Compare systematically:
- 1. Walk schema
properties tree recursively - For each schema key path, check if it exists in current config
- New/unset options = schema keys not present in current config (excluding keys with sensible defaults)
- Focus on actionable fields — ones where setting a non-default value provides clear benefit
- Flag fields from the changelog delta (new in this version) separately as "New in this release"
Present as a table:
CODEBLOCK6
5. Audit Current Setup
CODEBLOCK7
Collect:
- - Hooks: any hooks available but not enabled
- Doctor: all warnings and recommendations
- Skills: any ClawHub updates available
6. Present Comprehensive Report
Structure the report exactly like this:
CODEBLOCK8
Critical: Do NOT present a thin report. Every changelog entry that survived the relevance filter in Step 3 MUST appear. Every new config option from Step 4 MUST appear. Every doctor finding from Step 5 MUST appear. The user triggered this skill to see EVERYTHING.
7. Apply with Approval
Never apply without explicit user approval.
On approval, apply changes via:
- - Config changes: INLINECODE13
- Hook enablement: INLINECODE14
- Skill installs: INLINECODE15
After applying, pop any git stash:
CODEBLOCK9
8. Persist State
Write upgrade state to state.json in this skill's directory:
CODEBLOCK10
This prevents re-proposing on repeated runs and enables "what changed since last upgrade" queries.
升级 OpenClaw
更新、差异对比、审计、提议。每个新功能都呈现。无一遗漏。
设置
首次运行时,检查此技能目录中的 settings.json。如果未设置 subagentModel,则询问:
使用哪个模型作为升级子代理?(例如 claude-sonnet-4-6、deepseek-chat)。注意:外部提供商将接收配置数据。
保存到 settings.json:
json
{ subagentModel: anthropic/claude-sonnet-4-6 }
流程
1. 记录更新前状态
在操作任何内容之前:
bash
PRE_VERSION=$(openclaw --version | grep -oP \d{4}\.\d+\.\d+)
echo $PRE_VERSION
保存 PRE_VERSION — 用于步骤3中的变更日志差异对比。
2. 执行更新
bash
openclaw update
如果工作目录有未提交更改,先暂存:
bash
cd $(openclaw --version 2>&1 | grep -oP (?<=\().*?(?=\)) || echo ~/openclaw)
git stash --include-untracked -m pre-update stash && openclaw update
记录新版本:
bash
POST_VERSION=$(openclaw --version | grep -oP \d{4}\.\d+\.\d+)
如果 PREVERSION == POSTVERSION,报告已是最新版本并跳转到步骤5(仅审计)。
3. 提取差异变更日志
更新后,变更日志位于本地的 ~/openclaw/CHANGELOG.md。版本以 ## YYYY.x.x 标题分隔。
仅提取新旧版本之间的条目:
bash
awk /^## $POSTVERSION/,/^## $PREVERSION/ ~/openclaw/CHANGELOG.md
然后根据此配置的相关性进行过滤:
- 1. 通过 gateway config.get 读取当前配置,识别已启用的渠道/插件
- 从变更日志差异中,保留匹配以下条件的条目:
- 已启用的渠道(例如 Telegram — 跳过 LINE/Discord/飞书等,除非已启用)
- 核心代理/网关/定时任务/工具/内存/安全变更(始终相关)
- ACP/会话/子代理变更(如果 ACP 已启用)
- 破坏性变更(始终相关)
- 3. 丢弃未启用渠道、iOS/macOS 应用变更以及未使用平台的条目
- 分类保留的条目:功能 | 修复 | 安全 | 破坏性变更
4. 配置模式差异分析
获取实时模式和当前配置:
- - 模式:gateway config.schema
- 当前:gateway config.get
系统化比较:
- 1. 递归遍历模式 properties 树
- 对于每个模式键路径,检查当前配置中是否存在
- 新的/未设置的选项 = 当前配置中不存在的模式键(排除具有合理默认值的键)
- 关注可操作的字段 — 设置非默认值能带来明显好处的字段
- 将来自变更日志差异的字段(此版本新增)单独标记为此版本新增
以表格形式呈现:
| 配置路径 | 类型 | 默认值 | 描述 | 新增? |
5. 审计当前设置
bash
openclaw hooks list --json
openclaw doctor --non-interactive
clawhub update --all --dry-run 2>&1
收集:
- - 钩子:任何可用但未启用的钩子
- 诊断:所有警告和建议
- 技能:任何可用的 ClawHub 更新
6. 呈现综合报告
严格按照以下结构组织报告:
markdown
🔍 升级后报告:{PREVERSION} → {POSTVERSION}
🆕 新功能(与您的设置相关)
- 配置:path.to.setting(如适用)
🔧 值得注意的修复
🔐 安全更新
⚠️ 破坏性变更
📋 新增配置选项
| 配置路径 | 类型 | 默认值 | 启用原因 |
|-------------|------|---------|------------|
🪝 钩子状态
🏥 诊断建议
📦 可用技能更新
应用这些改进? 回复:
- - yes / all — 全部应用
- select — 我将列出编号项目供选择
- 按名称指定项目
关键:不要呈现简略报告。步骤3中通过相关性过滤的每个变更日志条目都必须出现。步骤4中的每个新配置选项都必须出现。步骤5中的每个诊断结果都必须出现。用户触发此技能是为了看到所有内容。
7. 经批准后应用
未经用户明确批准,绝不应用。
批准后,通过以下方式应用更改:
- - 配置更改:gateway config.patch
- 启用钩子:openclaw hooks enable <钩子>
- 安装技能:clawhub install <技能>
应用后,弹出任何 git 暂存:
bash
cd ~/openclaw && git stash list | grep -q pre-update stash && git stash pop
8. 持久化状态
将升级状态写入此技能目录中的 state.json:
json
{
lastUpgrade: {
from: 2026.3.2,
to: 2026.3.3,
timestamp: 2026-03-05T06:50:00Z,
featuresProposed: [telegram-streaming, pdf-tool, ...],
featuresApplied: [telegram-streaming, ...],
doctorApplied: [entrypoint-fix, ...]
}
}
这可以防止重复运行时重新提议,并支持自上次升级以来有哪些变化的查询。