OpenClaw 升级排坑实录:2026.7.1-2 → 2026.8.1

温馨提醒
总结摘要
OpenClaw 从 2026.7.1-2 升级到 2026.8.1 的完整排坑实录:15 个坑覆盖 doctor 迁移失败、多 agent 静默失灵、钉钉插件 ERR_PACKAGE_PATH_NOT_EXPORTED、cron 工具授权过期,附升级流程、报错速查表和回滚方案

本文记录一次 OpenClaw 跨版本升级(2026.7.1-2 → 2026.8.1)中踩过的所有坑:具体现象、报错原文、根因分析与处理方法。适合准备升级或正在升级 OpenClaw 多 agent 部署的同学参考。

为保护隐私,文中所有主机路径、IP、账号名、密钥类信息均已脱敏(以占位符或省略号表示),不影响技术细节。

背景

  • 部署形态:单机多 agent(1 个主 agent + 5 个子 agent),子 agent 通过钉钉机器人路由分发消息
  • 模型供应商:DeepSeek + 本地 Ollama embedding(memory search 用)
  • 第三方插件:钉钉官方 channel 插件、Brave 搜索、SearXNG、llama.cpp、小米 MiMo 等
  • 操作系统:Ubuntu 24.04,网关以 systemd user 服务方式托管

升级目标:从 2026.7.1-2 升级到 2026.8.1。

升级前准备(必做)

开始之前,先把这三件事做完,能省掉后面一大半的惊吓:

1. 确认当前版本

1
openclaw --version

2. 备份(最重要的一步,别跳过)

1
openclaw backup create

备份完成后会生成一个带时间戳的 tar 包,通常在 ~ 目录下,形如:

1
~/2026-09-01T11-12-42.425+08-00-openclaw-backup.tar.gz

建议顺手验证一下备份文件完整可读:

1
openclaw backup verify ~/2026-09-01T11-12-42.425+08-00-openclaw-backup.tar.gz

⚠️ 注意:如果你的工作区技能目录里有绝对路径符号链接,备份会直接失败(详见坑 14)。建议备份前先检查一遍,把绝对链接改成相对链接,别等备份失败才回头处理。

3. 预估耗时与风险

  • 整体耗时约 30~60 分钟(取决于数据量、插件数量和网络速度),备份文件可能很大(本次 762MB),磁盘要留够空间
  • 升级期间网关会重启,所有 agent 和通道会短暂中断
  • 风险最高的环节是第三方 channel 插件(钉钉/Telegram/Discord 类),大版本升级后它们往往第一个崩(详见坑 6)

升级流程总览

整个升级的正确姿势(踩完坑后的总结):

flowchart TD A[1. openclaw backup create<br/>先备份] --> B[2. openclaw update<br/>升级本体] B --> C[3. openclaw doctor --fix<br/>迁移配置与状态<br/>可能要多跑几轮] C --> D[4. openclaw gateway status --deep<br/>检查插件版本漂移] D --> E[5. openclaw plugins update<br/>升级漂移插件] E --> F[6. openclaw gateway restart<br/>重启加载] F --> G[7. openclaw doctor --lint --all<br/>剩余问题复查] G --> H[8. 逐项验证<br/>agent / 通道 / cron / heartbeat / memory]

坑清单(按主题分组)

升级过程本身

坑 1:openclaw update 报 “Update result: ERROR (doctor failed)”

现象:包本体已更新到 2026.8.1,但命令以失败告终,提示 doctor 检查未通过。

根因:2026.8.1 做了大量配置键迁移。旧配置里的键在新版不再被识别,doctor 是唯一合法迁移通道;而 doctor 又可能被旧状态文件卡住(见坑 3),形成连环阻塞。

处理:不要被 ERROR 吓退,版本其实已经装上。先用 openclaw --version 确认版本号,然后继续执行 openclaw doctor --fix 完成迁移即可。

坑 2:配置校验失败,报一堆 unrecognized keys

报错(截取):

1
2
3
4
5
6
7
8
config validation failed with unrecognized keys:
meta: lastTouchedAt
browser.ssrfPolicy: hostnameAllowlist
agents.defaults.compaction: reserveTokens, maxHistoryShare
agents.defaults: memorySearch
gateway.controlUi: allowInsecureAuth
gateway.tailscale: resetOnExit
gateway.nodes: denyCommands

根因:跨大版本配置键改名/移动。本次实际遇到的映射:

旧键新键
browser.ssrfPolicy.hostnameAllowlistbrowser.ssrfPolicy.allowedHostnames
agents.defaults.memorySearchmemory.search
agents.defaults.models(映射表)agents.defaults.modelPolicy.allow
gateway.nodes.denyCommandsgateway.nodes.commands.deny
tools.exec.security / tools.exec.asktools.exec.mode
agents.list(数组)agents.entries(keyed 对象)
meta.lastTouchedAt迁入 SQLite

处理:运行 openclaw doctor --fix,它会自动迁移并在验证成功后删除旧键

⚠️ 不要手动改配置绕过,否则会留下半迁移状态,后续 doctor 可能反复报错。

坑 3:doctor –fix 死循环:“Legacy exec approvals exist”

报错

1
2
Legacy exec approvals exist at ~/.openclaw/exec-approvals.json.
Run `openclaw doctor --fix` before using exec approvals.

但运行 doctor –fix 又报同样的错——鸡生蛋问题

flowchart LR A[旧 exec-approvals.json 存在] --> B[doctor --fix 拒绝运行<br/>防止并发写坏] B --> C[旧审批记录无法迁移] C --> D[提示先运行 doctor --fix] D --> A

根因:新版把 exec 审批记录迁移到 SQLite。旧 JSON 文件必须由 doctor 迁移;doctor 又拒绝在旧文件存在时运行(防并发写坏)。

处理(临时绕过):把旧文件移走备份,再跑 doctor:

1
2
mv ~/.openclaw/exec-approvals.json ~/openclaw-exec-approvals.json.bak
openclaw doctor --fix

⚠️ 代价:旧审批记录不再生效(新系统从零开始),需要重新审批。这是本次唯一"绕行"而非"正规迁移"的操作,建议保留备份文件。

坑 4:多 agent 配置校验失败

报错

1
2
agents.ownership: multi-agent rosters require agents.ownership="explicit"
or one legacy default=true marker

根因:2026.8.1 起,多 agent 环境必须显式声明所有权模式。

处理:doctor –fix 自动写入 agents.ownership: "explicit"(日志:Stamped the multi-agent roster for explicit per-surface ownership)。

子 agent 无法使用(本次最核心的两个坑)

坑 5:子 agent 会话全部报 “Legacy workspace setup state requires migration”

现象:某个子 agent 完全不可用——每次发消息都失败,dashboard 和 API 均报错。

报错

1
2
Error: Legacy workspace setup state requires migration
for ~/.openclaw/workspace/<agent>; run openclaw doctor --fix.

而 doctor –fix 迁移时又失败:

1
2
Failed migrating legacy workspace state:
legacy workspace setup conflicts with canonical SQLite state

根因:该 agent 工作区里残留旧版遗留文件 .openclaw/workspace-state.json(内含 bootstrap/setup 时间戳),其内容与 SQLite 中已存在的规范状态冲突(时间戳不一致)。doctor 出于数据安全 fail-closed,拒绝覆盖;运行时也 fail-closed,拒绝在未迁移状态下创建会话。于是该 agent 被"双重锁死":

flowchart TD A[遗留 workspace-state.json<br/>时间戳与 SQLite 规范状态冲突] --> B[doctor 迁移失败<br/>fail-closed 拒绝覆盖] A --> C[运行时拒绝创建会话<br/>fail-closed] B --> D[agent 双重锁死<br/>完全不可用] C --> D D --> E[归档 sidecar 文件<br/>+ 重启网关] E --> F[agent 恢复正常]

本次只有 1 个子 agent 中招(其余 agent 无此遗留文件)。

处理:SQLite 已是权威状态源,把遗留 sidecar 归档即可(该文件仅含时间戳,无业务数据):

1
2
3
4
5
6
# 先用 openclaw agents list 查看实际的 agent id,替换下面的 <agent>
openclaw agents list

mv ~/.openclaw/workspace/<agent>/.openclaw/workspace-state.json \
   ~/.openclaw/workspace/<agent>/.openclaw/workspace-state.json.conflict-bak-$(date +%Y%m%d)
openclaw gateway restart

重启后 agent 恢复正常。

教训:跨版本迁移时,若 doctor 报 “conflicts with canonical”,说明 SQLite 才是新的真相源,旧 sidecar 文件可安全归档(先备份)。

坑 6:钉钉通道全挂:ERR_PACKAGE_PATH_NOT_EXPORTED

现象:所有钉钉账号无法连接,日志里无限循环重启(attempt 5/10、6/10…),所有走钉钉路由的子 agent 全部失联。

报错

1
2
3
4
Package subpath './plugin-sdk/channel-runtime' is not defined by "exports"
in .../dingtalk-connector/node_modules/openclaw/package.json
[dingtalk-connector][账号A] startAccount error: ...
channel exited: ... auto-restart attempt 5/10

根因:已装的钉钉 channel 插件 0.8.24 与 2026.8.1 不兼容——插件内部捆绑的旧版 openclaw 包没有 ./plugin-sdk/channel-runtime 这个导出子路径,新版运行时不认:

flowchart TD A[主程序升级到 2026.8.1] --> B[钉钉插件 0.8.24<br/>仍捆绑旧版 openclaw 包] B --> C[插件运行时请求<br/>./plugin-sdk/channel-runtime] C --> D{旧包 exports<br/>未声明该子路径} D -->|不兼容| E[ERR_PACKAGE_PATH_NOT_EXPORTED] E --> F[通道无限重启 attempt 5/10] F --> G[钉钉路由的子 agent 全部失联] H[openclaw plugins update dingtalk-connector] --> I[插件 0.8.25<br/>openclaw 链接到全局新版] I --> J[通道恢复]

处理:升级插件到兼容版本(0.8.25 会把 openclaw peerDependency 链接到全局新版):

1
2
openclaw plugins update dingtalk-connector
openclaw gateway restart

教训:大版本升级后第一件事查插件版本漂移openclaw gateway status --deep)。第三方 channel 插件(钉钉/Telegram/Discord 类)往往是最先崩的点。

插件类问题

坑 7:官方插件版本漂移

现象openclaw gateway status --deep 报:

1
2
3
Plugin version drift: 4 active official plugins not on gateway 2026.8.1
- brave: 2026.7.1 → expected 2026.8.1
- deepseek / llama-cpp / searxng 同理

处理:逐个升到与网关相同版本:

1
2
3
4
openclaw plugins update @openclaw/[email protected]
openclaw plugins update @openclaw/[email protected]
openclaw plugins update @openclaw/[email protected] --accept-capabilities
openclaw plugins update @openclaw/[email protected]

注:llama-cpp 需要带 --accept-capabilities,否则更新被拒。插件实际名字以 openclaw plugins list 输出为准。

现象:doctor 诊断对每一个 agent 都报 WARN:

1
2
Plugin "deepseek" requires capability consent; disable and re-enable it
or run `openclaw plugins enable deepseek --accept-capabilities`

根因:升级后 capability consent 记录重置,6 个插件(brave / deepseek / dingtalk-connector / llama-cpp / searxng / xiaomi)需要重新接受。

处理

1
2
3
4
5
6
openclaw plugins enable brave --accept-capabilities
openclaw plugins enable deepseek --accept-capabilities
openclaw plugins enable dingtalk-connector --accept-capabilities
openclaw plugins enable llama-cpp --accept-capabilities
openclaw plugins enable searxng --accept-capabilities
openclaw plugins enable xiaomi --accept-capabilities

多 agent 后台功能静默失灵(最隐蔽的一批)

坑 9:cron.list 报 UNAVAILABLE、heartbeat 被禁用

报错

1
2
3
4
Agent-less cron job has no resolvable owner. Pass --agent <id> when
creating or editing the job, or set agents.defaults.systemAgent.agentId.
⇄ res ✗ cron.list ... errorCode=UNAVAILABLE
memory-core: dreaming cron reconcile failed: ...

同时 doctor 警告:Multi-agent config has no ambient heartbeat owner; heartbeats stay disabled

根因:2026.8.1 要求多 agent 环境必须有显式的 ambient owner(systemAgent),迁移过程没有自动填充。

处理

1
openclaw config set agents.defaults.systemAgent.agentId main

设完 heartbeat 立即生效,cron.list 恢复。

坑 10:talk.catalog 报 AGENT_SELECTION_REQUIRED

报错

1
2
Multiple agents are configured, but Talk relay ownership has no explicit owner.
Set talk.agentId to the agent that owns unscoped Talk sessions.

处理

1
openclaw config set talk.agentId main

坑 11:cron 工具授权过期

报错openclaw doctor --lint --all):

1
2
3
6 tool-bearing automations require explicit scheduled authority reauthorization.
fixHint: Review with openclaw automations list --all and reauthorize with
openclaw automations edit <id> --tools <tool,...>

根因:升级后 cron 任务不再继承旧权限,工具列表必须显式重写。

处理:先列出所有任务,找到报错的那几个:

1
openclaw automations list --all

然后对每个任务,把原来的工具列表写回去(按实际任务需要的工具替换):

1
openclaw automations edit <job-id> --tools exec,read,write

批量处理可参考这个脚本(先导出 JSON 查看每个任务现有的 toolsAllow,再逐个 edit --tools 写回):

1
2
3
# 导出任务列表(含工具授权信息),人工确认后按上面命令逐个写回
openclaw automations list --all --json > /tmp/automations.json
jq -r '.[] | "\(.id)\t\(.tools // "(无工具限制)")"' /tmp/automations.json

坑 12:cron 任务因模型空闲超时连续失败

报错

1
2
The model did not produce a response before the model idle timeout.
increase models.providers.<id>.timeoutSeconds ...

现象:一个巡检类 cron 任务连续失败 7 次。

处理

1
openclaw config set models.providers.deepseek.timeoutSeconds 180

周边设施

坑 13:技能全部失效:“description is required”

报错

1
[skills] Skipping invalid skill. source=.../SKILL.md error="description is required"

根因:2026.8.1 强制要求 SKILL.md 使用 YAML frontmatter 且必须包含 description 字段。本次 3 个技能失效:

  • 2 个用了旧式 JSON frontmatter{...}
  • 1 个完全没有 frontmatter

全部被静默跳过(只在日志里 WARN),其中还包括某个子 agent 自己的图片上传技能。

处理:统一改成 YAML frontmatter:

1
2
3
4
5
6
---
name: skill-name
description: 一句话说明这个技能干什么
---

# 正文

改完后用 openclaw doctor --lint --all 复查是否还有技能类 findings。顺带检查技能内部引用的脚本路径是否还正确(本次有一个技能引用了已不存在的路径)。

坑 14:备份失败:符号链接必须相对

报错

1
2
Backup archive write failed: Archive symbolic link target must be relative:
.../workspace-ops/skills/<skill> -> /home/<user>/.openclaw/skills/<skill>

根因:某工作区的技能目录里有一个绝对路径符号链接,备份工具出于安全拒绝打包绝对链接。

处理:改为相对链接后备份成功:

1
ln -sfn ../../skills/<skill> <link-name>.tmp && mv -Tf <link-name>.tmp <link-name>

坑 15:memory 自动同步静默失效(旧版本遗留 bug,新版已修复)

背景:2026.7.1-2 的 memorySearch 原生自动同步(watch / intervalMinutes / onSearch / onSessionStart)静默失效(GitHub issue #20556 / #7464),表现为索引不更新但无任何报错。当时用 systemd user timer 每 30 分钟手动跑一次增量索引兜底。

升级后验证:2026.8.1 已修复——新建一个 probe 文件,25 秒内自动进入索引,无需手动触发。

处理:验证修复后退役兜底 timer,恢复正常原生同步(timer 名字替换成你自己的,systemctl --user list-timers 可查):

1
2
3
systemctl --user disable --now openclaw-memory-index.timer
rm ~/.config/systemd/user/openclaw-memory-index.{service,timer}
systemctl --user daemon-reload

同时更新状态文件、停用对应的巡检 cron(使命完成)。

报错速查表

升级过程中遇到问题,先按这个表定位到对应坑:

现象 / 报错关键字对应坑
Update result: ERROR (doctor failed)坑 1
unrecognized keys坑 2
Legacy exec approvals exist 且 doctor –fix 反复报同样的错坑 3
require agents.ownership="explicit"坑 4
Legacy workspace setup state requires migration坑 5
ERR_PACKAGE_PATH_NOT_EXPORTED + 通道无限重启坑 6
Plugin version drift坑 7
requires capability consent坑 8
cron.list ... UNAVAILABLE / heartbeats stay disabled坑 9
AGENT_SELECTION_REQUIRED(talk.catalog)坑 10
require explicit scheduled authority reauthorization坑 11
model idle timeout坑 12
Skipping invalid skill ... description is required坑 13
Archive symbolic link target must be relative坑 14
memory 索引不更新但无报错(静默)坑 15

升级失败怎么办(回滚)

备份就是为了这一刻。openclaw backup 支持从备份恢复:

1
2
# 恢复到一个全新的暂存目录(不会直接覆盖现有配置,先人工核对)
openclaw backup restore ~/2026-09-01T11-12-42.425+08-00-openclaw-backup.tar.gz

恢复流程是"恢复到暂存目录 → 人工核对 → 再决定是否替换",不是一步覆盖,所以放心跑。核对无误后,把暂存内容放回原位(~/.openclaw/ 下对应位置),然后重启网关:

1
openclaw gateway restart

建议:备份文件保留到确认升级完全正常(所有验证项通过)之后再清理。

附录:命令汇总(按执行顺序)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# —— 升级前 ——
openclaw --version                          # 确认当前版本
openclaw backup create                      # 备份
openclaw backup verify <备份文件>            # 验证备份(可选但推荐)

# —— 升级 ——
openclaw update                             # 升级本体(可能报 ERROR,忽略)

# —— 迁移与修复 ——
openclaw doctor --fix                       # 配置迁移(多跑几轮直到干净)
openclaw gateway status --deep              # 检查插件漂移
openclaw plugins update <漂移插件>           # 升级漂移插件(官方插件带 @2026.8.1)
openclaw plugins enable <插件> --accept-capabilities   # 重新接受 capability consent
openclaw gateway restart                    # 重启加载
openclaw doctor --lint --all                # 剩余问题复查

# —— 多 agent 后台修复 ——
openclaw config set agents.defaults.systemAgent.agentId main   # cron/heartbeat
openclaw config set talk.agentId main                           # Talk relay
openclaw automations list --all             # 查看 cron 任务
openclaw automations edit <id> --tools <工具列表>   # 重写 cron 工具授权

# —— 回滚(仅升级失败时)——
openclaw backup restore <备份文件>           # 恢复到暂存目录,人工核对