Skip to content

MM plugin: SIGUSR1 hot-reload breaks WebSocket session routing for group channels #19968

@ppurekid

Description

@ppurekid

Bug Description

After applying a config change via SIGUSR1 (hot-reload), the Mattermost WebSocket monitor continues to receive messages but routes them to incorrect sessions, causing replies to be silently dropped (never delivered to the channel).

Steps to Reproduce

  1. Have an OpenClaw gateway running with channels.mattermost configured (chatmode: "onmessage")
  2. Bot is a member of multiple MM channels (e.g., office-general and a custom channel like protocol-evolution)
  3. Apply a config change via SIGUSR1 (e.g., changing chatmode from oncall to onmessage)
  4. Send a message in the custom channel

Expected Behavior

Bot receives the message, agent processes it, and the reply is delivered back to the same channel.

Actual Behavior

  • The gateway log shows config hot reload applied (channels.mattermost.chatmode) — config change is accepted
  • The MM WebSocket connection stays alive (TCP ESTABLISHED)
  • Messages are received and the agent runs successfully (generates reply text)
  • But the reply is never delivered to the channel — no delivered reply to channel:xxx log entry
  • The session lane changes from the correct session:agent:main:mattermost:channel:<channel_id> to a generic session:mm-<botname> with messageChannel= (empty)
  • The agent's reply text appears in gateway.log but is followed by silence instead of delivery confirmation

Workaround

A full gateway restart (launchctl kickstart -k / openclaw gateway stop && start) fixes the issue. Only SIGUSR1 hot-reload is affected.

Evidence from Logs

Before SIGUSR1 (working):

lane enqueue: lane=session:agent:main:mattermost:channel:4i7mryg4tffkijnamzrxjozbpc
[mattermost] delivered reply to channel:4i7mryg4tffkijnamzrxjozbpc

After SIGUSR1 (broken):

lane enqueue: lane=session:mm-rex queueSize=1
embedded run start: runId=xxx sessionId=mm-rex messageChannel=
# Agent generates reply "在,我这边在线。" but no delivery log follows

Environment

  • OpenClaw version: 2026.2.15
  • Node.js: v25.6.1
  • OS: macOS (Darwin arm64)
  • Mattermost: self-hosted, HTTP (not HTTPS)
  • Config: chatmode: "onmessage", dmPolicy: "open", groupPolicy: "open"

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