← Back to PRs

#23261: fix(feishu): bitable tools fail to register with accounts config pattern

by stakeswky open 2026-02-22 04:47 View on GitHub →
channel: feishu size: XS
## Problem `registerFeishuBitableTools` directly reads `config.channels.feishu.appId/appSecret`, which returns `undefined` when users configure Feishu credentials via the `accounts` sub-object pattern (e.g. `channels.feishu.accounts.myapp.appId`). This means bitable tools silently skip registration for any user using the accounts-based configuration. ## Fix Replace the direct config read with `listEnabledFeishuAccounts(api.config)`, using `accounts[0]` to create the client — matching the pattern already used by `docx.ts`, `drive.ts`, and `wiki.ts`. ### Changes - `extensions/feishu/src/bitable.ts`: Import `listEnabledFeishuAccounts` from `./accounts.js`, remove unused `FeishuConfig` type import, rewrite credential resolution to use the accounts helper. Fixes #23243 <!-- greptile_comment --> <h3>Greptile Summary</h3> Fixes bitable tool registration for users with accounts-based Feishu configuration by replacing direct config read with `listEnabledFeishuAccounts()` helper. **Key changes:** - Replaced direct `config.channels.feishu.appId/appSecret` access with `listEnabledFeishuAccounts(api.config)` - Uses `accounts[0]` to create the client, matching the pattern in `docx.ts`, `drive.ts`, and `wiki.ts` - Removed unused `FeishuConfig` type import, added `listEnabledFeishuAccounts` import The fix ensures bitable tools register correctly for both legacy (top-level credentials) and new (accounts sub-object) configuration patterns. <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with no risk - The change is a straightforward refactor that aligns bitable.ts with the established pattern used across docx.ts, drive.ts, and wiki.ts. The implementation correctly uses the accounts helper, properly handles the case when no accounts are configured, and maintains backward compatibility via the listEnabledFeishuAccounts function which handles both legacy and new config patterns. - No files require special attention <sub>Last reviewed commit: b1c3116</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs