feat(feishu): per-message session for group top-level messages

Align with deer-flow: group top-level messages (no root_id) now get
their own session keyed by message_id instead of sharing a single
group-wide session. Topic replies continue to share session via
root_id.
This commit is contained in:
chengyongru
2026-04-26 16:09:31 +08:00
committed by Xubin Ren
parent 0e92936cf3
commit 39eea1b762
2 changed files with 7 additions and 8 deletions
+4 -4
View File
@@ -1728,11 +1728,11 @@ class FeishuChannel(BaseChannel):
return
# Build topic-scoped session key for conversation isolation.
# Group chat: thread replies (root_id != message_id) get a scoped
# session so each Feishu thread has its own conversation context.
# Group chat: each topic gets its own session via root_id (replies
# inside a topic) or message_id (top-level messages start a new topic).
# Private chat: no override — same behavior as Telegram/Slack.
if chat_type == "group" and root_id and root_id != message_id:
session_key = f"feishu:{chat_id}:{root_id}"
if chat_type == "group":
session_key = f"feishu:{chat_id}:{root_id or message_id}"
else:
session_key = None