← Back to PRs

#19871: fix(feishu): support multi-account config in bitable tools

by linbojin open 2026-02-18 07:59 View on GitHub →
channel: feishu size: XS
## Problem The bitable tools (introduced in #17963) were not registering when using the new multi-account Feishu configuration format. **Root cause**: `registerFeishuBitableTools` was directly reading `config.channels.feishu.appId` and `config.channels.feishu.appSecret`, which only works for the legacy single-account format. ## Solution Updated `registerFeishuBitableTools` to align with the pattern used by other Feishu tool modules (docx, wiki, drive): - Use `listEnabledFeishuAccounts()` to get configured accounts - Use `resolveToolsConfig()` to support `tools.bitable` enable/disable option - Pass `firstAccount` directly to `createFeishuClient` for consistency - Add `bitable` to `FeishuToolsConfig` type, schema, and defaults ## Changes ```diff extensions/feishu/src/bitable.ts | 26 insertions(+), 5 deletions(-) extensions/feishu/src/types.ts | 1 + extensions/feishu/src/tools-config.ts | 1 + extensions/feishu/src/config-schema.ts | 1 + ``` ## Testing Verified that: - ✅ Bitable tools now register correctly with multi-account config - ✅ Successfully created bitable apps, fields, and records - ✅ Pattern is consistent with other Feishu tool modules - ✅ `tools.bitable` config option works correctly <img width="2428" height="598" alt="image" src="https://github.com/user-attachments/assets/ee2b91af-adad-4de6-ad04-3362661bad5b" /> ## Related - Fixes tool registration for users on the new multi-account config format - Builds on #17963 <!-- greptile_comment --> <h3>Greptile Summary</h3> Fixes bitable tool registration for users on the multi-account Feishu config format. The previous implementation directly accessed `config.channels.feishu.appId`/`appSecret`, which only worked with the legacy single-account format. Now uses `listEnabledFeishuAccounts()` and `resolveToolsConfig()`, consistent with how docx, wiki, drive, and perm tool modules are registered. Also adds `bitable` to `FeishuToolsConfig` type, schema, and defaults so it can be toggled via config. - Two minor style nits: the disable check uses `=== false` rather than the `!toolsCfg.xxx` pattern used by other modules, and the `DEFAULT_TOOLS_CONFIG` JSDoc doesn't mention bitable. <h3>Confidence Score: 4/5</h3> - This PR is safe to merge — it aligns bitable tool registration with an established, well-tested pattern used by other Feishu tool modules. - The changes are straightforward and follow the exact same pattern as docx, wiki, drive, and perm tool registration. The only findings are minor style inconsistencies. No logic bugs or security issues identified. - No files require special attention. <sub>Last reviewed commit: f3278f6</sub> <!-- greptile_other_comments_section --> <sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub> <!-- /greptile_comment -->

Most Similar PRs