mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-03 16:24:05 +00:00
fix: preserve explicit Feishu bitable gates
This commit is contained in:
committed by
Peter Steinberger
parent
5cfb578cba
commit
73bb84e4bf
@@ -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 |
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -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