Skip to content

[Bug]: Multi-channel response routing leaks to wrong channel when messages arrive simultaneously #4530

@methyl

Description

@methyl

Summary

When multiple channels are active (e.g., WhatsApp + iMessage), a response intended for one channel can leak to another channel if a message arrives on the second channel while the agent is processing a request from the first.

Steps to reproduce

  1. Configure both WhatsApp and iMessage channels
  2. Start a conversation on WhatsApp
  3. While WhatsApp conversation is ongoing, receive an unrelated iMessage from a different contact
  4. The agent's response (meant for WhatsApp) gets sent to the iMessage contact instead

Expected behavior

Responses should be pinned to the channel/session that initiated the request. The "current channel" context should not be overwritten by incoming messages from other channels.

Actual behavior

The response is routed to the most recently received message's channel, not the channel that initiated the request. This causes:

  • Privacy leaks (sensitive content sent to wrong recipients)
  • Context confusion (audit results from one conversation appearing in another)

Environment

  • OpenClaw version: 2026.1.29
  • OS: macOS
  • Install method: npm
  • Channels configured: WhatsApp (selfChatMode), iMessage

Root cause hypothesis

The gateway's "current channel" state appears to get clobbered when a new message arrives from a different channel during processing. The response routing should be bound to the originating session/channel at request time, not at response time.

Possible fix directions

  1. Pin response routing to the session that initiated the request
  2. Add channel isolation to prevent cross-channel context switching during processing
  3. Queue incoming messages from other channels until the current request completes

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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