← Back to PRs

#22735: feat(plugin): add feishu-media extension

by cintia09 open 2026-02-21 15:50 View on GitHub →
size: XL
Adds `@openclaw/feishu-media` — Feishu audio STT and media payload utilities. **What it does:** - Feishu native `speech_to_text` API integration with tenant token caching and rate-limit retry - Whisper STT fallback via remote HTTP service or local CLI - `buildFeishuMediaPayload()` with `Transcript` field support for audio messages - Media understanding debug logger for diagnostics Disabled by default — set `enabled: true` in plugin config to activate. <!-- greptile_comment --> <h3>Greptile Summary</h3> This PR adds two new extensions: `@openclaw/feishu-media` (Feishu audio STT and media payload utilities) and `@openclaw/embedding-fts` (unified embedding system with FTS5 fallback). Both are disabled by default and require `enabled: true` in plugin config. - **Runtime crash in `feishu-media`**: `api.lifecycle.onHealthCheck()` is called in `index.ts`, but `OpenClawPluginApi` has no `lifecycle` property — this will throw a `TypeError` when the plugin is enabled. - **TypeScript error in `embedding-fts`**: `api.on("health", ...)` uses `"health"` as a hook name, but it is not in the `PluginHookName` union type — this will not compile. - **Broken test imports in `embedding-fts`**: The test file imports from `"../src/embedding.js"` but the correct path from `__tests__/` is `"../embedding.js"` — tests will fail to run. - **Missing `devDependencies` in `feishu-media`**: `openclaw` is not listed in `devDependencies` (only `peerDependencies`), diverging from the standard extension pattern and potentially breaking dev-time module resolution. Also declares `vitest ^3.0.0` while the workspace root uses `^4.0.18`. - The `feishu-media` and `embedding-fts` core logic (STT integration, embedding providers, FTS5 loader, media payload builder) is well-structured with reasonable error handling and test coverage. <h3>Confidence Score: 2/5</h3> - This PR has multiple issues that will cause runtime errors and test failures when the plugins are enabled — it should not be merged as-is. - Score of 2 reflects three distinct bugs: (1) `api.lifecycle.onHealthCheck()` in feishu-media will throw a TypeError at runtime since `lifecycle` doesn't exist on the plugin API, (2) `api.on("health", ...)` in embedding-fts uses an invalid hook name that won't pass TypeScript compilation, and (3) embedding-fts test imports use a wrong relative path (`../src/embedding.js` instead of `../embedding.js`) so tests won't run. The plugins are disabled by default which limits blast radius, but these must be fixed before merging. - Pay close attention to `extensions/feishu-media/index.ts` (runtime crash on `api.lifecycle`), `extensions/embedding-fts/index.ts` (invalid hook name), and `extensions/embedding-fts/src/__tests__/embedding.test.ts` (broken import path). <sub>Last reviewed commit: 844d50d</sub> <!-- greptile_other_comments_section --> **Context used:** - Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13)) <!-- /greptile_comment -->

Most Similar PRs