mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 16:21:37 +00:00
feat(feishu): support sender/topic-scoped group session routing (openclaw#17798) thanks @yfge
Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: yfge <1186273+yfge@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
@@ -91,12 +91,23 @@ const FeishuToolsConfigSchema = z
|
||||
.optional();
|
||||
|
||||
/**
|
||||
* Group session scope for routing Feishu group messages.
|
||||
* - "group" (default): one session per group chat
|
||||
* - "group_sender": one session per (group + sender)
|
||||
* - "group_topic": one session per group topic thread (falls back to group if no topic)
|
||||
* - "group_topic_sender": one session per (group + topic thread + sender),
|
||||
* falls back to (group + sender) if no topic
|
||||
*/
|
||||
const GroupSessionScopeSchema = z
|
||||
.enum(["group", "group_sender", "group_topic", "group_topic_sender"])
|
||||
.optional();
|
||||
|
||||
/**
|
||||
* @deprecated Use groupSessionScope instead.
|
||||
*
|
||||
* Topic session isolation mode for group chats.
|
||||
* - "disabled" (default): All messages in a group share one session
|
||||
* - "enabled": Messages in different topics get separate sessions
|
||||
*
|
||||
* When enabled, the session key becomes `chat:{chatId}:topic:{rootId}`
|
||||
* for messages within a topic thread, allowing isolated conversations.
|
||||
*/
|
||||
const TopicSessionModeSchema = z.enum(["disabled", "enabled"]).optional();
|
||||
|
||||
@@ -108,6 +119,7 @@ export const FeishuGroupSchema = z
|
||||
enabled: z.boolean().optional(),
|
||||
allowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
||||
systemPrompt: z.string().optional(),
|
||||
groupSessionScope: GroupSessionScopeSchema,
|
||||
topicSessionMode: TopicSessionModeSchema,
|
||||
})
|
||||
.strict();
|
||||
@@ -153,6 +165,8 @@ export const FeishuAccountConfigSchema = z
|
||||
connectionMode: FeishuConnectionModeSchema.optional(),
|
||||
webhookPath: z.string().optional(),
|
||||
...FeishuSharedConfigShape,
|
||||
groupSessionScope: GroupSessionScopeSchema,
|
||||
topicSessionMode: TopicSessionModeSchema,
|
||||
})
|
||||
.strict();
|
||||
|
||||
@@ -171,6 +185,7 @@ export const FeishuConfigSchema = z
|
||||
dmPolicy: DmPolicySchema.optional().default("pairing"),
|
||||
groupPolicy: GroupPolicySchema.optional().default("allowlist"),
|
||||
requireMention: z.boolean().optional().default(true),
|
||||
groupSessionScope: GroupSessionScopeSchema,
|
||||
topicSessionMode: TopicSessionModeSchema,
|
||||
// Dynamic agent creation for DM users
|
||||
dynamicAgentCreation: DynamicAgentCreationSchema,
|
||||
|
||||
Reference in New Issue
Block a user