openclaw - 💡(How to fix) Fix Feature Request: Feishu DM thread/topic-based session isolation [1 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#70512Fetched 2026-04-24 05:57:08
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants
RAW_BUFFERClick to expand / collapse

Feature Request

Channel: Feishu (Lark) Current behavior: All DM messages from the same user route to a single session, regardless of Feishu topic/thread ID. Requested behavior: Support per-topic session isolation in Feishu DMs, similar to how group topics already get separate sessions.

Problem

When using Feishu DMs, creating a new topic (话题) in the conversation does not create a new session on the gateway side. All messages from the same open_id share one session, regardless of topic_id / thread_id.

This is inconvenient when:

  • Working on multiple independent tasks in the same DM via different topics
  • Want to keep context isolated between different conversations with the same person

Current Code Analysis

In monitor-BFekcwtJ.js, the peer resolution logic:

```javascript const peerId = isGroup ? groupSession?.peerId ?? ctx.chatId : ctx.senderOpenId; ```

For group chats, groupSessionScope supports `"group_topic"` and `"group_topic_sender"` modes, which create separate sessions per topic. For DMs, peerId is always `ctx.senderOpenId`, ignoring any `topic_id` in the message event.

Comparison with Other Channels

  • Matrix: Has `dm.sessionScope: "per-room"` to isolate each DM room into its own session
  • Telegram: Supports `message_thread_id` in private chats for thread-aware session keys
  • Feishu groups: Already supports `groupSessionScope: "group_topic"` for per-topic sessions

Proposed Solution

Add a Feishu DM-level config option, for example:

```json5 { channels: { feishu: { dm: { // Session isolation mode for DMs: // "per-user" (default): all DMs from same user share one session // "per-topic": each topic/thread in DM gets its own session sessionScope: "per-topic" } } } } ```

When `sessionScope: "per-topic"`, the gateway should use `topic_id` (or `root_id`) from Feishu message events to generate separate session keys for different topics within the same DM.

Use Case

Users who use Feishu DMs as a workspace with multiple topics want each topic to have its own isolated agent session, with independent context, models, and configurations — similar to how group topic conversations already work.

Environment

  • OpenClaw version: 2026.4.5
  • Channel: Feishu (WebSocket mode)
  • OS: macOS (arm64)

Thanks for considering this feature! 🙏

extent analysis

TL;DR

To achieve per-topic session isolation in Feishu DMs, add a sessionScope config option for Feishu DMs and modify the peer resolution logic to use topic_id for session key generation.

Guidance

  • Introduce a new config option sessionScope for Feishu DMs with values "per-user" (default) and "per-topic" to control session isolation.
  • Update the peer resolution logic in monitor-BFekcwtJ.js to use topic_id or root_id from Feishu message events when sessionScope is set to "per-topic".
  • Verify the fix by checking if separate sessions are created for different topics within the same DM.
  • Consider adding a fallback or default behavior for cases where topic_id is missing or invalid.

Example

const peerId = isGroup ? groupSession?.peerId ?? ctx.chatId : (ctx.sessionScope === "per-topic" ? ctx.topicId : ctx.senderOpenId);

Notes

The proposed solution assumes that the topic_id or root_id from Feishu message events can be reliably used to generate unique session keys. Additional error handling and edge case consideration may be necessary.

Recommendation

Apply the workaround by introducing the sessionScope config option and updating the peer resolution logic, as this provides a flexible and explicit way to control session isolation for Feishu DMs.

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 Feature Request: Feishu DM thread/topic-based session isolation [1 participants]