#16337: feat(feishu): sync community plugin updates from clawdbot-feishu v0.1.10
channel: feishu
size: XL
Cluster:
Feishu Integration Enhancements
## Summary
Follow-up sync after [#12662](https://github.com/openclaw/openclaw/pull/12662): backport latest Feishu plugin changes from the community repository [`m1heng/clawdbot-feishu`](https://github.com/m1heng/clawdbot-feishu), aligned to release `v0.1.10`.
Sync basis:
- Previous sync point in OpenClaw: `ee8312a` (from #12662)
- Current source snapshot: `b0cfb0344` (`clawdbot-feishu` v0.1.10)
## What’s synced
- Upstream Feishu backports from community repo (security/media hardening, DM policy handling, reply dispatch updates, dedup module extraction, SDK alignment).
- Modularized Feishu tools structure introduced in community repo:
- `src/bitable-tools/*`
- `src/task-tools/*`
- `src/tools-common/*`
- Current plugin runtime/config/policy behavior from community repo across `extensions/feishu/src/*`.
- Skill docs refresh under `extensions/feishu/skills/*`.
## Compatibility choice in this PR
To keep current OpenClaw semantics and avoid behavior drift, this PR **keeps existing mention gating behavior**:
- if `botOpenId` is unavailable, `mentionedBot = false`.
(Community repo currently uses a fallback that treats any mention as trigger when `botOpenId` is missing; that fallback is intentionally not adopted here.)
## Validation
- Ran Feishu extension tests in OpenClaw:
- `vitest --config vitest.extensions.config.ts extensions/feishu/src/**/*.test.ts`
- Result: **7 files passed, 21 tests passed**.
## Notes
- Commit includes only `extensions/feishu/**` changes.
- This PR is intended as a source sync for preparing further official integration work.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Syncs the Feishu plugin to community repo `clawdbot-feishu` v0.1.10, bringing multi-account tool infrastructure, new task and bitable tool modules, document handling improvements, and various hardening changes.
**Key changes:**
- **Multi-account tool execution**: Introduced `AsyncLocalStorage`-based context propagation (`tool-context.ts`) and centralized tool execution wrapper (`tool-exec.ts`) so tools resolve the correct Feishu account at runtime rather than at registration time
- **Modularized tool structure**: Bitable tools extracted from monolithic `bitable.ts` into `bitable-tools/*`; new `task-tools/*` module for Feishu Task v2 API; shared API utilities in `tools-common/feishu-api.ts`
- **Document improvements**: Table content preservation during docx insertion, batched block inserts with retry/backoff, new `import_document` drive action
- **Per-account dedup**: Message dedup now scopes by account ID to prevent cross-account collisions
- **Streaming default changed**: Streaming card mode changed from opt-out (`!== false`) to opt-in (`=== true`)
- **Probe caching**: Added result caching for probe calls to avoid API rate limits
**Issues found:**
- `clearProbeCache(accountId)` has a key mismatch: cache keys use `appId:domain` format but the function matches against `accountId`, so targeted cache clearing will never work
- `importDocument` in `drive.ts` hardcodes `https://feishu.cn` in returned URLs, which is incorrect for Lark-domain accounts
<h3>Confidence Score: 3/5</h3>
- This PR is generally safe to merge but has two logic bugs that should be addressed: a broken probe cache invalidation path and hardcoded domain URLs.
- The PR is a large, well-structured community sync that brings meaningful multi-account infrastructure. Tests are reported passing (21 tests, 7 files). Most changes are clean refactors and additions. However, two logic bugs were identified: `clearProbeCache` will silently fail to clear entries for specific accounts due to a key format mismatch, and `importDocument` hardcodes `feishu.cn` URLs that won't work for Lark-domain users. These reduce confidence from 4 to 3.
- `extensions/feishu/src/probe.ts` (cache key mismatch in clearProbeCache), `extensions/feishu/src/drive.ts` (hardcoded domain URL in importDocument)
<sub>Last reviewed commit: fbed936</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#15671: fix(feishu): Credentials check bug of Feishu bitable tools when usi...
by zxh0916 · 2026-02-13
81.4%
#19871: fix(feishu): support multi-account config in bitable tools
by linbojin · 2026-02-18
79.9%
#14674: feat(feishu): add feishu_chat tool for chat info/member queries
by liuweifly · 2026-02-12
79.2%
#16284: fix(feishu): route tool credentials by account parameter
by Yaxuan42 · 2026-02-14
79.0%
#11304: feishu: cache bot info to reduce probe API calls (feishu set low qu...
by jasonthewhale · 2026-02-07
78.0%
#21484: fix(feishu): scope message deduplication by accountId to support mu...
by guanyu-zhang · 2026-02-20
77.2%
#20973: Fix: Feishu duplicate plugin ID, Docker pairing docs, broken formal...
by neipor · 2026-02-19
77.1%
#23261: fix(feishu): bitable tools fail to register with accounts config pa...
by stakeswky · 2026-02-22
75.9%
#9268: Fix: Register feishu as official channel in CHAT_CHANNEL_ORDER
by vishaltandale00 · 2026-02-05
75.2%
#14037: docs: improved permission configuration instructions
by LHB6540 · 2026-02-11
75.0%