openclaw - 💡(How to fix) Fix [Feishu] group_topic session splits when different root_id formats (omt_ vs om_) used for same topic [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#71438Fetched 2026-04-26 05:12:40
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
0
Participants
Timeline (top)
closed ×1commented ×1

Root Cause

Root Cause (traced via source)

Fix Action

Fix / Workaround

Workaround

Code Example

rootId: event.message.root_id || void 0,
// ...
const topicScope = normalizedRootId ?? normalizedThreadId ?? ...

---

// Instead of:
const topicScope = normalizedRootId ?? normalizedThreadId ?? ...

// Consider:
const topicScope = normalizedThreadId ?? normalizedRootId ?? ...
RAW_BUFFERClick to expand / collapse

Bug: Feishu group_topic session splits into two sessions for same topic

Environment

  • OpenClaw (latest)
  • Channel: Feishu/Lark
  • Config: groupSessionScope: "group_topic" on a specific group

Steps to Reproduce

  1. Configure a Feishu group with groupSessionScope: "group_topic" and replyInThread: "enabled"
  2. In a Feishu 话题群 (topic group), Person A sends a message mentioning the bot — this creates a new topic thread
  3. Person B (or the same person) replies inside that same topic thread, mentioning the bot again

Expected Behavior

Both messages are in the same topic thread → same session key → same conversation context

Actual Behavior

Two different sessions are created:

  • Message 1 (topic creator): ...group:<chatId>:topic:omt_1a89bd796d0f1c93 — topicId prefix is omt_
  • Message 2 (reply inside topic): ...group:<chatId>:topic:om_x100b51f715c93ca0b3f5db08eaf7497 — topicId prefix is om_

Root Cause (traced via source)

In monitor.js, session key is built from event.message.root_id:

rootId: event.message.root_id || void 0,
// ...
const topicScope = normalizedRootId ?? normalizedThreadId ?? ...

Feishu returns two different root_id formats for the same topic:

  • The topic-creator message has root_id = omt_xxx (topic object ID)
  • Replies inside the topic have root_id = om_xxx (the creator message's message ID)

These two values are different strings → different topicScope → different session keys.

Suggested Fix

Prefer thread_id over root_id as the canonical topic key when building the session scope. In Feishu topic groups, thread_id consistently carries the omt_xxx topic object ID across all messages in the same thread, while root_id varies between omt_xxx (topic creator) and om_xxx (replies).

// Instead of:
const topicScope = normalizedRootId ?? normalizedThreadId ?? ...

// Consider:
const topicScope = normalizedThreadId ?? normalizedRootId ?? ...

Workaround

Use groupSessionScope: "group_sender" instead — each sender gets their own session regardless of topic, avoiding the split.

extent analysis

TL;DR

Prefer thread_id over root_id when building the session scope to fix the Feishu group topic session split issue.

Guidance

  • Verify that using thread_id instead of root_id resolves the session split by checking the session keys generated for messages in the same topic thread.
  • Update the monitor.js code to prioritize thread_id over root_id when determining the topicScope, as suggested in the issue.
  • Test the fix with different scenarios, such as multiple replies and messages from different senders, to ensure the session context is maintained correctly.
  • Consider the workaround of using groupSessionScope: "group_sender" if the fix is not feasible or causes other issues.

Example

const topicScope = normalizedThreadId ?? normalizedRootId ?? ...

This code change prioritizes thread_id over root_id when building the session scope.

Notes

This fix assumes that thread_id is consistently available and accurate for all messages in a Feishu topic group. If this is not the case, additional error handling or fallbacks may be necessary.

Recommendation

Apply the suggested fix by updating the monitor.js code to prioritize thread_id over root_id, as this should resolve the session split issue without introducing significant changes to the existing functionality.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Feishu] group_topic session splits when different root_id formats (omt_ vs om_) used for same topic [1 comments, 2 participants]