乐于分享
好东西不私藏

OpenClaw 26.5.3 飞书无法正常接收或发送消息的修复方法

OpenClaw 26.5.3 飞书无法正常接收或发送消息的修复方法

OpenClaw 26.5.3 及 Plugin SDK 的升级后,飞书插件可能会出现无法正常接收或发送消息。此文档整理了导致该问题的核心原因,并提供了完整的修复步骤。

问题现象

通过飞书给 OpenClaw发消息无响应。

服务启动警告:网关日志(gateway.err.log)中出现插件加载报错:

plugin not found: feishu (stale config entry ignored...)plugin must declare contracts.tools before registering agent toolschannel plugin manifest declares feishu without channelConfigs metadata

运行时崩溃:当在飞书发送消息给 Bot 时,后台报错:

TypeError: (0 , _pluginSdk.resolveSenderCommandAuthorization) is not a function

根本原因

插件标识变更:飞书插件的 ID 已从 feishu 变更为 openclaw-lark。旧的 openclaw.json 配置并未同步更新,导致新版插件未能被正确加载和启用。

Manifest 规范更新:新版 OpenClaw 要求插件必须在 openclaw.plugin.json 中显式声明 channelConfigs 以及 contracts.tools。

SDK 废弃旧兼容包:新版 OpenClaw Plugin SDK 移除了对统一入口 openclaw/plugin-sdk (compat bundle) 中部分方法(如 resolveSenderCommandAuthorization)的导出,强制要求使用规范的子路径 (subpath) 导入。插件源码由于未更新引入路径,导致运行时抛出 TypeError。

修复步骤:

请按照以下三个步骤手动修改对应的配置文件与源码,完成后重启服务。

1. 更新主配置文件 openclaw.json

文件路径:~/.openclaw/openclaw.json

在 plugins.entries 节点中,移除旧的 feishu 配置块,并将 openclaw-lark 的 enabled 设为 true。

   "plugins": {     "allow": [       "openclaw-lark",-      "feishu",       "openclaw-weixin",       ...     ],     "entries": {-      "openclaw-lark": {-        "enabled"false-      },-      "feishu": {-        "enabled"true,-        "config": {}-      },+      "openclaw-lark": {+        "enabled"true+      },

2. 更新插件清单 openclaw.plugin.json

文件路径:~/.openclaw/extensions/feishu-openclaw-plugin/openclaw.plugin.json

在 JSON 的最外层补充 channelConfigs 和 contracts 声明:

   "configSchema": {     "type""object",     "additionalProperties"false,     "properties": {}-  }+  },+  "channelConfigs": {+    "feishu": {}+  },+  "contracts": {+    "tools"true+  } }

3. 修复代码中的 SDK 导入路径

文件路径:~/.openclaw/extensions/feishu-openclaw-plugin/src/messaging/inbound/handler.js

由于 SDK 移除了统一入口的某些导出,你需要将原本单行的 import 拆分为按照子路径按需导入。

-import { recordPendingHistoryEntryIfEnabled, DEFAULT_GROUP_HISTORY_LIMIT, resolveSenderCommandAuthorization, isNormalizedSenderAllowed, } from 'openclaw/plugin-sdk';+import { recordPendingHistoryEntryIfEnabled, DEFAULT_GROUP_HISTORY_LIMIT } from 'openclaw/plugin-sdk/reply-history';+import { resolveSenderCommandAuthorization } from 'openclaw/plugin-sdk/command-auth';+import { isNormalizedSenderAllowed } from 'openclaw/plugin-sdk/allow-from'; import { getLarkAccount } from '../../core/accounts';

[!TIP] 如果你在插件的其它文件(例如 dispatch.js 等)中也遇到了类似报错,请参考官方 SDK Migration 文档,将对应的方法替换为其所在的具体子路径。

4. 重启 OpenClaw Gateway 服务

完成以上所有修改后,需要重启网关服务使代码及配置生效:

可以通过杀掉对应的 Node 进程来让系统或守护进程自动重启,或者执行你常用的重启命令:

杀掉当前的 gateway node 进程

# 杀掉当前的 gateway node 进程ps aux | grep "gateway --port 18789" | grep -v grep | awk '{print $2}' | xargs kill

(杀掉后守护进程通常会自动拉起新的网关)

检查日志确保没有报错:

tail -f ~/.openclaw/logs/gateway.err.log