Skip to content

[Bug]: Mattermost inbound messages lose newlines (multi-line Markdown received as single line) #12247

@echo931

Description

@echo931

Summary

In Mattermost DMs, multi-line user messages (including Markdown with headings/quotes/lists) are received by OpenClaw as a single line (newlines normalized to spaces). This breaks downstream Markdown parsing and is likely the root cause of flattened lists/quotes/headings in agent-visible text.

Why this matters

If inbound characters are stripped/normalized during ingestion, OpenClaw cannot reconstruct the original Markdown structure, and any Markdown-to-IR renderer will see a single paragraph instead of block nodes.

Steps to reproduce

  1. In Mattermost, send a message with explicit newlines, e.g.:
line1
line2
line3
  1. Observe on the OpenClaw side that the received content is flattened into one line: line1 line2 line3 (or otherwise missing ).

Expected behavior

OpenClaw should preserve inbound newlines exactly as sent by Mattermost so Markdown structure remains intact.

Actual behavior

Inbound messages appear normalized to a single line (newlines removed).

Environment

  • Channel: Mattermost
  • Clients used by reporter: Web, Desktop (Linux), Android

Related issues

Notes / Suspected cause

Possibly using the wrong field from the Mattermost WS event (e.g. a normalized/plain-text field) or performing newline normalization during message ingestion.

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