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

@@ -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({