← Back to PRs

#23255: fix(feishu): use listEnabledFeishuAccounts for bitable tool registration

by SidQin-cyber open 2026-02-22 04:35 View on GitHub →
channel: feishu size: XS
## Summary - **Problem:** \`registerFeishuBitableTools\` reads credentials directly from \`config.channels.feishu.appId/appSecret\`, but when Feishu is configured using the \`accounts\` sub-object (e.g., \`accounts.main\`), these top-level fields are absent and bitable tools silently fail to register. - **Why it matters:** Doc, drive, and wiki tools work fine with accounts mode, but bitable tools don't — creating an inconsistent experience. - **What changed:** Switched \`extensions/feishu/src/bitable.ts\` to use \`listEnabledFeishuAccounts(api.config)\` for credential resolution, matching the pattern in \`docx.ts\`, \`drive.ts\`, \`wiki.ts\`, and \`perm.ts\`. - **What did NOT change:** Top-level config mode still works (backward compatible). No changes to bitable tool behavior or API calls. ## Change Type (select all) - [x] Bug fix - [ ] Feature - [ ] Refactor - [ ] Docs - [ ] Security hardening - [ ] Chore/infra ## Scope (select all touched areas) - [ ] Gateway / orchestration - [x] Skills / tool execution - [ ] Auth / tokens - [ ] Memory / storage - [x] Integrations - [ ] API / contracts - [ ] UI / DX - [ ] CI/CD / infra ## Linked Issue/PR - Closes #23243 ## User-visible / Behavior Changes - Feishu bitable tools now register correctly when using \`accounts\` configuration mode - No config changes required ## Security Impact (required) - New permissions/capabilities? \`No\` - Secrets/tokens handling changed? \`No\` - New/changed network calls? \`No\` - Command/tool execution surface changed? \`No\` - Data access scope changed? \`No\` ## Repro + Verification ### Environment - OS: macOS 15.3 (arm64) - Runtime: Node v22+ - Integration/channel: Feishu ### Steps 1. Configure Feishu with accounts sub-object (\`channels.feishu.accounts.main\`) 2. Start gateway 3. Check if bitable tools register (no "credentials not configured" log) ### Expected - Bitable tools register successfully alongside doc/drive/wiki tools ### Actual - Before fix: Bitable tools silently skip registration (top-level \`appId\`/\`appSecret\` not found) - After fix: \`listEnabledFeishuAccounts\` resolves credentials from accounts sub-object ## Evidence The fix aligns bitable with the established pattern used by 4 other Feishu tool modules: | File | Uses \`listEnabledFeishuAccounts\` | |------|----------------------------------| | \`docx.ts\` | Yes | | \`drive.ts\` | Yes | | \`wiki.ts\` | Yes | | \`perm.ts\` | Yes | | \`bitable.ts\` | **No → Yes (this PR)** | ## Human Verification (required) - Verified scenarios: Compared bitable.ts against docx.ts, drive.ts, wiki.ts — confirmed the credential resolution pattern is identical after fix - Edge cases checked: \`listEnabledFeishuAccounts\` returns empty array when no accounts configured (early return preserved); top-level config still works via the same helper function - What I did **not** verify: Live Feishu bitable API calls (no Feishu test account) ## Compatibility / Migration - Backward compatible? \`Yes\` — \`listEnabledFeishuAccounts\` handles both config patterns - Config/env changes? \`No\` - Migration needed? \`No\` ## Failure Recovery (if this breaks) - How to disable/revert this change quickly: Revert \`extensions/feishu/src/bitable.ts\` - Files/config to restore: \`extensions/feishu/src/bitable.ts\` - Known bad symptoms: Bitable tools not appearing in tool list ## Risks and Mitigations None — the change reuses a proven helper function already used by 4 other modules in the same extension.

Most Similar PRs