Skip to content

[Bug] Multi-channel session routing - replies go to wrong channel #45514

@hkgood

Description

@hkgood

Bug Description

When receiving messages from multiple channels (Telegram, Feishu, Weibo), replies are sent to the wrong channel instead of the channel where the message originated.

Steps to Reproduce

  1. Configure multiple channels (e.g., Telegram, Feishu, Weibo) with active sessions
  2. Send a message from one channel (e.g., Feishu)
  3. The reply is sent to a different channel (e.g., Telegram) instead of Feishu

Expected Behavior

Replies should be sent to the same channel where the message came from.

Actual Behavior

Replies are sent to the lastChannel (the most recently active session) rather than the message origin channel.

Root Cause Analysis

From the session store:

  • agent:main:telegram:direct:1086468464 has lastChannel: telegram
  • agent:main:feishu:direct:ou_xxx has lastChannel: feishu

When a Feishu message arrives and is dispatched to the correct feishu session, the reply still goes to the channel with the most recent lastChannel (Telegram).

Logs

[feishu] feishu[default]: received message from ou_xxx in oc_xxx (p2p)
[feishu] feishu[default]: Feishu[default] DM from ou_xxx: "test message"
[feishu] feishu[default]: dispatching to agent (session=agent:main:feishu:direct:ou_xxx)
[telegram] sendMessage ok chat=1086468464 message=5296  <- Reply sent to wrong channel!

Version

  • OpenClaw: Latest (2026.3.x)
  • OS: macOS

Workaround

None. User must disable other channels to receive replies correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions