openclaw - 💡(How to fix) Fix [Bug]: 配置了 dmScope 为per-channel-peer,但是还是存在会话泄露,每个会话的 session 文件看的也是不同的 [1 comments, 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#54387Fetched 2026-04-08 01:28:14
View on GitHub
Comments
1
Participants
1
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
labeled ×2closed ×1commented ×1locked ×1

给公司的IM系统适配openclaw,使用websocket方式,参考的openclaw-feishu

发现配置了 dmScope 为per-channel-peer,但是还是存在会话泄露问题

看session 文件,每个会话的 session 文件看的也是不同的

Root Cause

给公司的IM系统适配openclaw,使用websocket方式,参考的openclaw-feishu

发现配置了 dmScope 为per-channel-peer,但是还是存在会话泄露问题

看session 文件,每个会话的 session 文件看的也是不同的

RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Summary

给公司的IM系统适配openclaw,使用websocket方式,参考的openclaw-feishu

发现配置了 dmScope 为per-channel-peer,但是还是存在会话泄露问题

看session 文件,每个会话的 session 文件看的也是不同的

Steps to reproduce

OpenClaw 2026.3.23-1

Expected behavior

多人同时跟openclaw对话时,互相对话信息隔离 现在单聊是互通的

Actual behavior

信息不隔离

OpenClaw version

OpenClaw 2026.3.23-1

Operating system

Ubuntu24.01

Install method

npm

Model

minimax

Provider / routing chain

openclaw -> minimax

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

Fix Plan

To address the issue of conversation information not being isolated between multiple users, we need to ensure that the dmScope configuration is properly set and handled in the OpenClaw implementation.

Step-by-Step Solution:

  1. Verify Configuration: Double-check that dmScope is set to per-channel-peer in your OpenClaw configuration file.
  2. Session Management: Ensure that each user's session is properly isolated. You can achieve this by generating a unique session ID for each user and storing their conversation history separately.
  3. WebSocket Handling: Modify the WebSocket handler to use the unique session ID to differentiate between users and ensure that messages are sent to the correct recipient.

Example Code Snippet (Node.js):

// Assuming you're using WebSocket and have a sessions object to manage user sessions
const WebSocket = require('ws');
const wss = new WebSocket.Server({ port: 8080 });
const sessions = {};

wss.on('connection', (ws) => {
  // Generate a unique session ID for the new connection
  const sessionId = generateUniqueId();
  sessions[sessionId] = ws;

  ws.on('message', (message) => {
    // Handle incoming message and ensure it's sent to the correct recipient
    const recipientId = getRecipientId(message);
    if (sessions[recipientId]) {
      sessions[recipientId].send(message);
    }
  });

  ws.on('close', () => {
    // Clean up the session when the connection is closed
    delete sessions[sessionId];
  });
});

// Function to generate a unique ID
function generateUniqueId() {
  return 'unique-id-' + Math.random().toString(36).substr(2, 9);
}

// Function to get the recipient's ID from the message
function getRecipientId(message) {
  // Implement logic to extract the recipient's ID from the message
  // For example, if the message contains the recipient's ID in a specific format
  return message.recipientId;
}

Verification

To verify that the fix worked, you can test the following scenarios:

  • Multiple users can have separate conversations without information leakage.
  • Each user's conversation history is properly isolated and not accessible to other users.

Extra Tips

  • Ensure that the dmScope configuration is correctly set and propagated throughout your application.
  • Implement proper error handling and logging to detect any issues that may arise during the conversation.
  • Consider implementing additional security measures, such as encryption, to further protect user conversations.

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…

FAQ

Expected behavior

多人同时跟openclaw对话时,互相对话信息隔离 现在单聊是互通的

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 [Bug]: 配置了 dmScope 为per-channel-peer,但是还是存在会话泄露,每个会话的 session 文件看的也是不同的 [1 comments, 1 participants]