feat(feishu): add replyInThread configuration for message replies (openclaw#27325) thanks @kcinzgg

Verified:
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: kcinzgg <13964709+kcinzgg@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
kcinzgg
2026-02-28 09:53:02 +08:00
committed by GitHub
parent 50aa6a43ed
commit 89669a33bd
12 changed files with 385 additions and 63 deletions

View File

@@ -1,5 +1,5 @@
import { describe, expect, it } from "vitest";
import { FeishuConfigSchema } from "./config-schema.js";
import { FeishuConfigSchema, FeishuGroupSchema } from "./config-schema.js";
describe("FeishuConfigSchema webhook validation", () => {
it("applies top-level defaults", () => {
@@ -86,3 +86,34 @@ describe("FeishuConfigSchema webhook validation", () => {
expect(result.success).toBe(true);
});
});
describe("FeishuConfigSchema replyInThread", () => {
it("accepts replyInThread at top level", () => {
const result = FeishuConfigSchema.parse({ replyInThread: "enabled" });
expect(result.replyInThread).toBe("enabled");
});
it("defaults replyInThread to undefined when not set", () => {
const result = FeishuConfigSchema.parse({});
expect(result.replyInThread).toBeUndefined();
});
it("rejects invalid replyInThread value", () => {
const result = FeishuConfigSchema.safeParse({ replyInThread: "always" });
expect(result.success).toBe(false);
});
it("accepts replyInThread in group config", () => {
const result = FeishuGroupSchema.parse({ replyInThread: "enabled" });
expect(result.replyInThread).toBe("enabled");
});
it("accepts replyInThread in account config", () => {
const result = FeishuConfigSchema.parse({
accounts: {
main: { replyInThread: "enabled" },
},
});
expect(result.accounts?.main?.replyInThread).toBe("enabled");
});
});