fix: preserve explicit Feishu bitable gates

This commit is contained in:
OpenClaw Updater
2026-05-31 12:39:24 +08:00
committed by Peter Steinberger
parent 5cfb578cba
commit 73bb84e4bf
3 changed files with 23 additions and 1 deletions

View File

@@ -584,6 +584,10 @@ Full configuration: [Gateway configuration](/gateway/configuration)
| `channels.feishu.blockStreaming` | Completed-block reply streaming | `false` |
| `channels.feishu.typingIndicator` | Send typing reactions | `true` |
| `channels.feishu.resolveSenderNames` | Resolve sender display names | `true` |
| `channels.feishu.tools.bitable` | Enable Bitable/Base tools | `true` |
| `channels.feishu.tools.base` | Alias for `channels.feishu.tools.bitable`; explicit `bitable` wins when both set | `true` |
| `channels.feishu.accounts.<id>.tools.bitable` | Per-account Bitable/Base tool gate | inherited |
| `channels.feishu.accounts.<id>.tools.base` | Per-account alias for `tools.bitable` | inherited |
---

View File

@@ -198,7 +198,10 @@ function mergeFeishuAccountConfig(cfg: ClawdbotConfig, accountId: string): Feish
if (merged.tools === undefined && topTools !== undefined) {
return { ...merged, tools: topTools };
}
if (topTools?.bitable === false || topTools?.base === false) {
if (
topTools?.bitable === false ||
(topTools?.bitable === undefined && topTools?.base === false)
) {
return {
...merged,
tools: {

View File

@@ -274,6 +274,21 @@ describe("feishu tool account routing", () => {
).toBe(0);
});
test("explicit top-level bitable enable wins over disabled base alias in account merge", async () => {
const { api, resolveTool } = createToolFactoryHarness(
createConfig({
topTools: { bitable: true, base: false },
toolsA: { bitable: true },
}),
);
registerFeishuBitableTools(api);
const tool = resolveTool("feishu_bitable_get_meta", { agentAccountId: "a" });
await tool.execute("call", { url: "invalid-url" });
expect(createFeishuClientMock.mock.calls.at(-1)?.[0]?.appId).toBe("app-a");
});
test("bitable tools are not registered when account bitable configs disable them", async () => {
const { api, registered, resolveTool } = createToolFactoryHarness(
createConfig({