Skip to content

Mattermost DM replies go to new Thread instead of main channel #59758

Description

@meredith620

Problem

When receiving a DM in Mattermost, bot replies go to a new Thread instead of the main DM channel.

Expected Behavior

  • DM main list message → reply should appear in main DM list
  • DM Thread message → reply should appear in that Thread

Current Behavior

All DM replies go to a new Thread, breaking the conversation flow.

Environment

  • OpenClaw with Mattermost plugin

Technical Details

The issue is in the resolveMattermostReplyRootId and resolveMattermostEffectiveReplyToId functions in auth-profiles-*.js.

Root Cause: The threadRootId check should be prioritized before kind === "direct" check. Currently for DM Thread messages, threadRootId is set but the logic causes replies to go to a new Thread.

Suggested Fix: Adjust the check order in both functions - threadRootId should be checked first, then kind === "direct" applies only when threadRootId is empty.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions