mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-09 09:42:53 +00:00
fix: preserve explicit Feishu bitable gates
This commit is contained in:
committed by
Peter Steinberger
parent
5cfb578cba
commit
73bb84e4bf
@@ -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: {
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user