Skip to content

Multi-surface main session: replies fan out to Telegram when message originates from WebChat/Control UI #34377

@justin7974

Description

@justin7974

Description

When multiple surfaces (Telegram, WebChat, Control UI) share the same agent:main:main session, replies to messages sent from WebChat or Control UI are also delivered to Telegram, instead of only going back to the originating surface.

Expected Behavior

Per the docs: "OpenClaw routes replies back to the channel where a message came from." Replies to WebChat messages should only go to WebChat; replies to Control UI messages should only go to Control UI.

Actual Behavior

Replies are also sent to Telegram, even when the message was sent from WebChat or Control UI. This results in duplicate messages appearing in Telegram.

Suspected Cause

Based on reading the channel-routing docs, the Main DM route pinning mechanism may be involved:

When session.dmScope is main, direct messages may share one main session. To prevent the session's lastRoute from being overwritten by non-owner DMs, OpenClaw infers a pinned owner from allowFrom when all of these are true:

  • allowFrom has exactly one non-wildcard entry

In my config, channels.telegram.allowFrom has exactly one entry (92813170), so Telegram is pinned as the owner. When WebChat/Control UI sends a message, the lastRoute may not update (since the webchat sender doesn't match the pinned Telegram owner), causing the reply to still route to Telegram.

Config (relevant parts)

{
  "channels": {
    "telegram": {
      "enabled": true,
      "dmPolicy": "allowlist",
      "allowFrom": ["92813170"]
    }
  },
  "gateway": {
    "bind": "lan",
    "controlUi": {
      "dangerouslyDisableDeviceAuth": true
    }
  }
}

No explicit session.dmScope or webchat config — using defaults.

Reproduction Steps

  1. Have Telegram + WebChat (PinchChat) + Control UI all connected to the same gateway
  2. Telegram allowFrom has exactly one entry
  3. Send a message from WebChat
  4. Observe: reply appears in both WebChat and Telegram
  5. Send from Telegram → reply only appears in Telegram (correct)

Environment

  • OpenClaw 2026.3.2 (85377a2)
  • macOS (Apple Silicon)
  • Model: claude-opus-4-6 (not relevant to routing)

Questions

  • Is this expected behavior for multi-surface main sessions?
  • If so, is there a config option to disable Telegram fan-out when the message originates from another surface?
  • Should WebChat/Control UI messages update lastRoute even when a pinned owner exists?

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    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