openclaw - 💡(How to fix) Fix [Bug] Feishu dispatch: TypeError - Cannot read properties of undefined (reading 'run')

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

2026-05-30T12:28:28.019+08:00 error channels/feishu feishu[gongchengshi]: failed to dispatch message: TypeError: Cannot read properties of undefined (reading 'run')
2026-05-30T12:52:20.550+08:00 error channels/feishu feishu[main]: failed to dispatch message: TypeError: Cannot read properties of undefined (reading 'run')

Root Cause

文件: monitor.account-Z4CGfEWQ.js 第 2599, 2657, 2731, 4268 行

问题: 代码直接调用 core.channel.inbound.run()core.channel.inboundundefined

// Line 2731
const turnResult = await core.channel.inbound.run({
  channel: "feishu",
  accountId: route.accountId,
  raw: ctx,
  adapter: {...}
});

分析:

  • core = getFeishuRuntime() 成功获取运行时对象
  • core.channel.routingsessionreplycommands 均存在
  • core.channel.inbound 从未被初始化,导致首次消息触发时直接抛出 TypeError

Fix Action

Fix / Workaround

feishu[main]: failed to dispatch message: TypeError: Cannot read properties of undefined (reading 'run')
  1. 向飞书 Bot 发送任意私信消息
  2. 消息到达后触发 dispatch
  3. 错误立即出现在日志中
2026-05-30T12:28:28.019+08:00 error channels/feishu feishu[gongchengshi]: failed to dispatch message: TypeError: Cannot read properties of undefined (reading 'run')
2026-05-30T12:52:20.550+08:00 error channels/feishu feishu[main]: failed to dispatch message: TypeError: Cannot read properties of undefined (reading 'run')

Code Example

feishu[main]: failed to dispatch message: TypeError: Cannot read properties of undefined (reading 'run')

---

// Line 2731
const turnResult = await core.channel.inbound.run({
  channel: "feishu",
  accountId: route.accountId,
  raw: ctx,
  adapter: {...}
});

---

if (!core.channel.inbound) {
  error(`feishu[${account.accountId}]: channel.inbound not initialized`);
  return;
}
await core.channel.inbound.run({...});

---

2026-05-30T12:28:28.019+08:00 error channels/feishu feishu[gongchengshi]: failed to dispatch message: TypeError: Cannot read properties of undefined (reading 'run')
2026-05-30T12:52:20.550+08:00 error channels/feishu feishu[main]: failed to dispatch message: TypeError: Cannot read properties of undefined (reading 'run')
RAW_BUFFERClick to expand / collapse

Bug Description

Feishu 消息投递时崩溃:

feishu[main]: failed to dispatch message: TypeError: Cannot read properties of undefined (reading 'run')

Steps to Reproduce

  1. 向飞书 Bot 发送任意私信消息
  2. 消息到达后触发 dispatch
  3. 错误立即出现在日志中

Root Cause Analysis

文件: monitor.account-Z4CGfEWQ.js 第 2599, 2657, 2731, 4268 行

问题: 代码直接调用 core.channel.inbound.run()core.channel.inboundundefined

// Line 2731
const turnResult = await core.channel.inbound.run({
  channel: "feishu",
  accountId: route.accountId,
  raw: ctx,
  adapter: {...}
});

分析:

  • core = getFeishuRuntime() 成功获取运行时对象
  • core.channel.routingsessionreplycommands 均存在
  • core.channel.inbound 从未被初始化,导致首次消息触发时直接抛出 TypeError

Expected Behavior

飞书消息应正常路由到 Agent 处理,不应因 core.channel.inbound 未初始化而崩溃。

Fix Recommendation

在所有 core.channel.inbound.run() 调用前添加防御性检查:

if (!core.channel.inbound) {
  error(`feishu[${account.accountId}]: channel.inbound not initialized`);
  return;
}
await core.channel.inbound.run({...});

长期修复:调查 channel-runtime.ts 初始化顺序,确保 inboundsetFeishuRuntime() 之前正确挂载。

Environment

  • OpenClaw: 2026.5.27
  • Node.js: 24.14.0
  • OS: Windows_NT 10.0.26200
  • Channel: Feishu (飞书)

Logs

2026-05-30T12:28:28.019+08:00 error channels/feishu feishu[gongchengshi]: failed to dispatch message: TypeError: Cannot read properties of undefined (reading 'run')
2026-05-30T12:52:20.550+08:00 error channels/feishu feishu[main]: failed to dispatch message: TypeError: Cannot read properties of undefined (reading 'run')

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug] Feishu dispatch: TypeError - Cannot read properties of undefined (reading 'run')