← Back to PRs

#16337: feat(feishu): sync community plugin updates from clawdbot-feishu v0.1.10

by graydawnc open 2026-02-14 17:05 View on GitHub →
channel: feishu size: XL
## 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