Skip to content

[maintainer] feat: Feishu/Lark channel support#7313

Closed
joshp123 wants to merge 1 commit intomainfrom
feishu-support
Closed

[maintainer] feat: Feishu/Lark channel support#7313
joshp123 wants to merge 1 commit intomainfrom
feishu-support

Conversation

@joshp123
Copy link
Contributor

@joshp123 joshp123 commented Feb 2, 2026

Human written summary:

The intent of this change is, as written by a human:

backport feishu support from github.com/jiulingyun/openclaw-cn

Changes

  • Port Feishu/Lark channel plugin from openclaw-cn fork
  • Feishu core: client, monitor, message, streaming-card, send, probe, accounts, config, pairing-store, access, format, bot, download
  • Domain config: channels.feishu.domain supports feishu (CN) and lark (global) endpoints
  • Outbound adapter + normalize helper for feishu:/lark: prefixes
  • Plugin extension: extensions/feishu/ (channel, onboarding, config-schema)
  • Docs: EN + zh-CN with screenshots
  • Test stability: increase Discord/Telegram unit timeouts for parallel runs
  • CHANGELOG: credit @jiulingyun (openclaw-cn)

Tests

  • pnpm lint
  • pnpm build
  • pnpm vitest run --config vitest.unit.config.ts src/telegram/bot.media.downloads-media-file-path-no-file-download.test.ts --maxWorkers 1
  • pnpm vitest run --config vitest.unit.config.ts src/discord/monitor.tool-result.accepts-guild-messages-mentionpatterns-match.test.ts --maxWorkers 1
  • pnpm test:all (fails in pnpm test:e2e: missing OPENCLAW_GATEWAY_TOKEN / gateway token mismatch; e2e failures include server.ios-client-id, gateway.multi, gateway server agent/chat/health/hooks/roles-allowlist/sessions-send, media-understanding.auto gemini, directive model list/help)

Risks

  • Lark global domain not verified against live tenant yet

Follow-ups

  • Add docs nav entry after channels group lands
  • Provide gateway auth token + gemini CLI if we want e2e green locally
  • Port CLI subcommands (openclaw feishu probe/send/accounts) if desired
  • Add src/feishu/strings.ts locale maps for i18n precursor

@joshp123 joshp123 added the maintainer Maintainer-authored PR label Feb 2, 2026
@openclaw-barnacle openclaw-barnacle bot added the docs Improvements or additions to documentation label Feb 2, 2026
What:
- clean up Feishu port for lint/type safety and error handling
- allow buffers in Feishu media uploads and tighten config merging
- increase Discord/Telegram unit test timeouts to reduce parallel flake

Why:
- backport Feishu support from openclaw-cn
- keep local test runs stable under parallel load

Tests:
- pnpm lint
- pnpm build
- pnpm vitest run --config vitest.unit.config.ts src/telegram/bot.media.downloads-media-file-path-no-file-download.test.ts --maxWorkers 1
- pnpm vitest run --config vitest.unit.config.ts src/discord/monitor.tool-result.accepts-guild-messages-mentionpatterns-match.test.ts --maxWorkers 1
- pnpm test:all (fails in pnpm test:e2e: missing OPENCLAW_GATEWAY_TOKEN / gateway token mismatch; failing e2e tests include server.ios-client-id, gateway.multi, server.agent/chat/health/hooks/roles-allowlist/sessions-send, media-understanding.auto gemini, directive model list/help)
@openclaw-barnacle openclaw-barnacle bot added channel: discord Channel integration: discord channel: telegram Channel integration: telegram labels Feb 2, 2026
@taiyi747
Copy link

taiyi747 commented Feb 3, 2026

Bug Report

1. Configuration & Command Errors
I encountered an error when using the CLI commands for Feishu (Lark):

  • Onboard: When running pnpm openclaw onboard, the first attempt was successful, but the second attempt failed.
  • Adding Channels: Subsequently, running pnpm openclaw channels add also triggers the same error.

Error Log:

ReferenceError: resolveDefaultFeishuAccountId is not defined
ELIFECYCLE Command failed with exit code 1.

10:32:57 [health] initial refresh failed: resolveDefaultFeishuAccountId is not defined

2. File Sending Issue (Private vs. Group Chat)
There is also an inconsistency when sending media files:

  • The bot cannot send files (images, videos, etc.) in Private Chats (DMs).
  • However, sending files works correctly in Group Chats.

3. Unresponsive /model Command
The bot does not respond when using the /model command to switch models. There is no feedback or confirmation message.

1. You already ran `openclaw channels add` for Feishu
2. The gateway is running (`openclaw gateway status`)

In **Event Subscription**:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But for lark,I can not found Use long connection to receive events

Image

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://open.feishu.cn/document/server-docs/event-subscription-guide/event-subscription-configure-/request-url-configuration-case?lang=en-US#14672524

image

Might this be what’s causing it?
->“Currently, long connection mode does not support store applications.”

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @AxiosLeo -- it's not this. Even when creating a custom app, ensuring you have logged App ID and App Secret to the binding wizard and restarting the gateway... this option never shows up on the Lark Developer Console for international users to select 'Use long connection'

Do the devs have a timeline for international support? Or is it better for us to build our own bridges?

@jiulingyun
Copy link
Contributor

jiulingyun commented Feb 3, 2026

✅ Feishu China Domain Test Results

I've tested the Feishu integration with the China domain (feishu.cn) and all core features are working correctly:

Feature Status
Message sending & receiving ✅ Pass
Streaming output (CardKit) ✅ Pass
Proactive image sending ✅ Pass
File sending (zip attachment) ✅ Pass
Pairing flow ✅ Pass

Test Screenshots

1. Pairing Flow & Basic Conversation
openclaw_feishu_test1

  • Pairing code generation works
  • Agent responds correctly after pairing approval

2. Proactive Screenshot Sending
openclaw_feishu_test2

  • Agent successfully captured screenshot using screencapture command
  • Image sent to Feishu chat via the media upload API

3. File Packaging & Sending
openclaw_feishu_test3

  • Agent zipped a folder (7.2MB) and sent it as attachment
  • File received correctly in Feishu client

All tests performed on openclaw-cn fork with Feishu self-built app using WebSocket persistent connection mode.

cc @jiulingyun (openclaw-cn maintainer)

@jiulingyun
Copy link
Contributor

Clarification: The above tests were performed by directly fetching this PR branch (openclaw:feishu-support) and running locally, not on the openclaw-cn fork codebase.

git fetch upstream pull/7313/head:pr-7313-feishu
git switch pr-7313-feishu
pnpm install && pnpm build && pnpm check  # all passed

This confirms the PR branch itself works correctly for Feishu China domain.

@joshp123
Copy link
Contributor Author

joshp123 commented Feb 3, 2026

Merged to main via fast-forward.

Commits:

  • 2483f26 Channels: add Feishu/Lark support
  • 0223416 Channels: finish Feishu/Lark integration

Tests:

  • pnpm build
  • pnpm check
  • pnpm test

Thanks @jiulingyun for the upstream work!

@joshp123
Copy link
Contributor Author

joshp123 commented Feb 3, 2026

Thanks to everyone who tested and reported issues @taiyi747 and. @panda1105 — we appreciate the help! We will fix the bugs rolling forward - we will first get the channel live so more Chinese users can benefit, and then fix bugs after.

@joshp123 joshp123 closed this Feb 3, 2026
@siwatanejo
Copy link

@joshp123 good work! BTW there's also a PR adding WeChat support, can that be looked at?

@joshp123
Copy link
Contributor Author

joshp123 commented Feb 4, 2026

@siwatanejo

@joshp123 good work! BTW there's also a PR adding WeChat support, can that be looked at?

Thanks! Yes, WeChat is on our radar. I have seen a couple of competing implementations, but also I am hearing conflicting stories - some people say that you will get instabanned for using it, others say that it's fine. And since I'm not Chinese or in mainland China, its hard for me to know for sure. So I'm hoping the community is able to converge on an answer here for me 😬 😅 Slightly chickening out but it is what it is. If you're not already on our discord, we have a threat in help-中文 for adding these things!

@zouhuigang
Copy link

(base) zouhuigang@zouhuigangdeMacBook-Air ~ % openclaw plugins install @openclaw/feishu
(node:54905) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

🦞 OpenClaw 2026.2.2-3 (9c5941b) — Your terminal just grew claws—type something and let the bot pinch the busywork.

Downloading @openclaw/feishu…
npm pack failed: npm notice Access token expired or revoked. Please try logging in again.
npm notice Access token expired or revoked. Please try logging in again.
npm error code E404
npm error 404 Not Found - GET https://registry.npmjs.org/@openclaw%2ffeishu - Not found
npm error 404
npm error 404  '@openclaw/feishu@*' is not in this registry.
npm error 404
npm error 404 Note that you can also install from a
npm error 404 tarball, folder, http url, or git url.
npm error A complete log of this run can be found in: /Users/zouhuigang/.npm/_logs/2026-02-04T02_55_33_413Z-debug-0.log

@jiulingyun
Copy link
Contributor

(base) zouhuigang@zouhuigangdeMacBook-Air ~ % openclaw plugins install @openclaw/feishu
(node:54905) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

🦞 OpenClaw 2026.2.2-3 (9c5941b) — Your terminal just grew claws—type something and let the bot pinch the busywork.

Downloading @openclaw/feishu…
npm pack failed: npm notice Access token expired or revoked. Please try logging in again.
npm notice Access token expired or revoked. Please try logging in again.
npm error code E404
npm error 404 Not Found - GET https://registry.npmjs.org/@openclaw%2ffeishu - Not found
npm error 404
npm error 404  '@openclaw/feishu@*' is not in this registry.
npm error 404
npm error 404 Note that you can also install from a
npm error 404 tarball, folder, http url, or git url.
npm error A complete log of this run can be found in: /Users/zouhuigang/.npm/_logs/2026-02-04T02_55_33_413Z-debug-0.log

Select local installation

@zouhuigang
Copy link

(base) zouhuigang@zouhuigangdeMacBook-Air ~ % openclaw plugins install @openclaw/feishu
(node:54905) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

🦞 OpenClaw 2026.2.2-3 (9c5941b) — Your terminal just grew claws—type something and let the bot pinch the busywork.

Downloading @openclaw/feishu…
npm pack failed: npm notice Access token expired or revoked. Please try logging in again.
npm notice Access token expired or revoked. Please try logging in again.
npm error code E404
npm error 404 Not Found - GET https://registry.npmjs.org/@openclaw%2ffeishu - Not found
npm error 404
npm error 404  '@openclaw/feishu@*' is not in this registry.
npm error 404
npm error 404 Note that you can also install from a
npm error 404 tarball, folder, http url, or git url.
npm error A complete log of this run can be found in: /Users/zouhuigang/.npm/_logs/2026-02-04T02_55_33_413Z-debug-0.log

Select local installation

openclaw channels add

谢谢,已经安装成功了。

@tokyo2006
Copy link

got warning:

Config warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/home/moltbot/.npm-global/lib/node_modules/openclaw/extensions/feishu/index.ts)

because I installed @m1heng-clawd/feishu before. How can I fix this warning?

@jaysenwu
Copy link

jaysenwu commented Feb 4, 2026

能加一个敲键盘的动作吗?如果bot已经接收到消息,并开始工作

@jiulingyun
Copy link
Contributor

jiulingyun commented Feb 4, 2026

能加一个敲键盘的动作吗?如果bot已经接收到消息,并开始工作

这个功能已经有了的,支持块级流式输出和卡片流式输出。
ScreenShot_2026-02-04_153541_743
ScreenShot_2026-02-04_153532_700

需要给飞书配置完整的权限,文档:https://clawd.org.cn/channels/feishu.html

@zixindh
Copy link

zixindh commented Feb 4, 2026

image 无法保存这个长链接的配置是怎么回事?一直报错。公开平台里其他的权限都已经打开了。

@jiulingyun
Copy link
Contributor

image 无法保存这个长链接的配置是怎么回事?一直报错。公开平台里其他的权限都已经打开了。

流程不对,按流程来,看一下文档:https://clawd.org.cn/channels/feishu.html

image

@zouhuigang
Copy link

@jiulingyun /reset指令好像不生效。

image

@jiulingyun
Copy link
Contributor

@jiulingyun /reset指令好像不生效。

image

用户命令将会在一个版本将会支持

@no010
Copy link

no010 commented Feb 5, 2026

如果之前的版本中安装了飞书插件,直接更新会不会有问题?

@kongdd
Copy link

kongdd commented Feb 5, 2026

这个PR跟https://github.com/m1heng/clawdbot-feishu是啥关系?
这个PR有点捣乱啊,开源社区力量分散了。
本来clawdbot-feishu用的好好的,而且别人的channel id已经注册了feishu。

你这个PR,抢占别人的channel id,直接导致大批clawdbot-feishu 用户无法使用。

m1heng/clawdbot-feishu#171, #8650

@zouhuigang
Copy link

飞书的消息展示不全,丢失了前面的内容。
image

完整的内容前面还有很多:
image

@zouhuigang
Copy link

@jiulingyun 大佬,消息展示不全。

@soniclue
Copy link

soniclue commented Feb 5, 2026

这个PR跟https://github.com/m1heng/clawdbot-feishu是啥关系? 这个PR有点捣乱啊,开源社区力量分散了。 本来clawdbot-feishu用的好好的,而且别人的channel id已经注册了feishu。

你这个PR,抢占别人的channel id,直接导致大批clawdbot-feishu 用户无法使用。

m1heng/clawdbot-feishu#171, #8650

+1. I had the same issue. Had to remove m1heng/clawdbot-feishu otherwise the conflict prevents gateway to start.
m1heng/clawdbot-feishu has much better features than the now built-in one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord channel: telegram Channel integration: telegram docs Improvements or additions to documentation maintainer Maintainer-authored PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.