Skip to content

fix(matrix): THINKING_TAG_RE missing mm: namespace prefix in monitor replies #99412

Description

@sheyanmin

Problem

The THINKING_TAG_RE and THINKING_BLOCK_RE regex patterns in extensions/matrix/src/matrix/monitor/replies.ts are missing the mm: namespace prefix for detecting MiniMax reasoning tags.

Context

PR #93767 fixed the core reasoning-tags.ts, and PRs #93806/#93820 fixed additional missed locations (silent-reply, streaming, iMessage paths). However, the Matrix monitor's replies.ts was also missed.

The regex currently matches antml: namespaced tags but not mm: namespaced tags:

const THINKING_TAG_RE = /<\s*\/?\s*(?:think(?:ing)?|thought|antthinking)\b[^<>]*>/gi;
//                                     ^^^ missing (?:antml:|mm:)?

Impact

MiniMax model mm:think reasoning content is not recognized as reasoning-only by shouldSuppressReasoningReplyText(), causing raw reasoning tags to leak into Matrix room messages.

Fix

Add (?:antml:|mm:)? prefix to think(?:ing)? and thought in both THINKING_TAG_RE and THINKING_BLOCK_RE, consistent with the pattern applied in the 6 already-fixed files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions