openclaw - 💡(How to fix) Fix [Bug]: [WeCom] DM消息隔离失效 - 不同用户的私聊被路由到同一会话 [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#52778Fetched 2026-04-08 01:19:31
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
labeled ×2commented ×1subscribed ×1
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Summary

Bug描述

企业微信渠道下,不同用户发给OpenClaw Agent的私聊消息被错误路由到同一会话。例如:用户A发给Agent的私信,会错误出现在用户B的会话中。

环境信息

  • OpenClaw版本:2026.3.12
  • WeCom插件版本:2026.3.20
  • Channel:wecom

Steps to reproduce

复现步骤

  1. 配置企业微信作为channel
  2. 用户A向OpenClaw发送私信
  3. 用户B在自己的会话中能看到用户A发给Agent的消息

诊断结果

经排查发现:

  • resolveAgentRoute 函数未正确处理私聊(DM)会话路由
  • 所有DM消息被路由到 agent:main:main 而非独立用户会话
  • 群聊正常,私聊隔离失效

飞书渠道无此问题,因其实现了dynamic agent creation机制。

Expected behavior

每个企业微信用户的私聊应该有独立的会话隔离,互不干扰。

Actual behavior

所有企业微信用户的私聊消息都被路由到同一会话(agent:main:main),而非每个用户独立的会话。例如用户A发给OpenClaw的消息会出现在用户B的会话中。

OpenClaw version

2026.3.12

Operating system

Linux docker

Install method

No response

Model

MiniMax

Provider / routing chain

wecom → openclaw → agent:main:main

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 resolve the issue of incorrect routing of private chat messages in the WeCom channel, we need to modify the resolveAgentRoute function to correctly handle private chat (DM) sessions.

Step-by-Step Solution:

  1. Update the resolveAgentRoute function to check if the incoming message is a private chat message.
  2. Create a unique session ID for each user's private chat.
  3. Route private chat messages to their respective user sessions instead of the default agent:main:main session.

Example Code:

def resolveAgentRoute(message):
    # Check if the message is a private chat message
    if message['type'] == 'private':
        # Create a unique session ID for the user
        user_id = message['user_id']
        session_id = f"agent:private:{user_id}"
        return session_id
    else:
        # Default session ID for non-private messages
        return "agent:main:main"

Infra/Dependency Fixes:

  • Ensure that the WeCom plugin version is compatible with the OpenClaw version.
  • Verify that the dynamic agent creation mechanism is implemented for the WeCom channel.

Verification

To verify that the fix worked:

  1. Send a private chat message from User A to the OpenClaw Agent.
  2. Check if the message appears only in User A's conversation and not in User B's conversation.
  3. Repeat the test with multiple users to ensure that each user's private chat messages are isolated and not visible to other users.

Extra Tips

  • Regularly review and update the resolveAgentRoute function to ensure it handles different message types and scenarios correctly.
  • Consider implementing the dynamic agent creation mechanism for the WeCom channel to improve scalability and performance.

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

每个企业微信用户的私聊应该有独立的会话隔离,互不干扰。

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]: [WeCom] DM消息隔离失效 - 不同用户的私聊被路由到同一会话 [1 comments, 2 participants]