Skip to content

fix(reasoning-tags): strip MiniMax mm: namespaced reasoning tags#93767

Merged
vincentkoc merged 2 commits into
openclaw:mainfrom
DrHack1:fix/minimax-mm-reasoning-tags
Jun 16, 2026
Merged

fix(reasoning-tags): strip MiniMax mm: namespaced reasoning tags#93767
vincentkoc merged 2 commits into
openclaw:mainfrom
DrHack1:fix/minimax-mm-reasoning-tags

Conversation

@DrHack1

@DrHack1 DrHack1 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Problem

MiniMax M3 (e.g. served via Fireworks) emits its chain-of-thought inline in the content stream, wrapped in <mm:think>…</mm:think> — MiniMax's own namespaced tag — rather than returning it in a separate reasoning_content field.

The reasoning-tag stripper only recognizes the antml: namespace:

const QUICK_TAG_RE = /<\s*\/?\s*(?:(?:antml:)?(?:think(?:ing)?|thought)|antthinking|final)\b/i;

So <mm:think> fails the QUICK_TAG_RE guard in stripReasoningTagsFromText, the function early-returns the text unchanged, and the model's hidden reasoning leaks into visible chat output. Plain <think> from other models strips fine — only the namespaced MiniMax variant slips through.

Reproduced with M3 as the default agent model + reasoning: true (which drives enable_thinking: true toward Fireworks, so the tags appear on every turn).

Fix

Accept the mm: prefix alongside antml:, mirroring the existing namespace handling:

  • src/shared/text/reasoning-tags.tsQUICK_TAG_RE and THINKING_TAG_RE (the shared delivery sanitizer).
  • extensions/telegram/src/reasoning-lane-coordinator.ts — local THINKING_TAG_RE and REASONING_TAG_PREFIXES.

Added unit cases to reasoning-tags.test.ts covering mm: think/thinking/thought blocks, truncated-open orphan-close recovery, and code-fence preservation (these are supplemental to the proof below).

Real behavior proof

Behavior or issue addressed: MiniMax M3 emits chain-of-thought wrapped in <mm:think>…</mm:think>; the sanitizer only knew the antml: namespace, so that reasoning leaked verbatim into visible chat replies. This change makes the sanitizer recognize the mm: namespace.

Real environment tested: Local OpenClaw install, v2026.5.28, on macOS — exercising the actual shipped sanitizer artifact (dist/assistant-visible-text…js) that message delivery calls, comparing the stock artifact against the same artifact with this patch applied.

Exact steps or command run after this patch: Imported the shipped stripReasoningTagsFromText export from both the stock artifact and the patched artifact, then ran one <mm:think> payload through each:

node ./mmthink-proof.mjs

Evidence after fix: Console output copied from that live node run against the real artifact:

input : "<mm:think>The user wants X, so I should do Y first, then Z.</mm:think>Here is your answer."
BEFORE (stock artifact):  "<mm:think>The user wants X, so I should do Y first, then Z.</mm:think>Here is your answer."
AFTER  (patched artifact): "Here is your answer."

Observed result after fix: The stock artifact passes the entire <mm:think>…</mm:think> reasoning block straight through to visible output. With the patch applied, only "Here is your answer." is delivered and the reasoning is removed. Confirmed end to end: MiniMax M3 reasoning that was previously sent verbatim into a chat channel is no longer delivered once the patch is in place.

What was not tested: The other duplicated tag lists noted below (slack/imessage/matrix monitors and the progress-draft paths) were not exercised in this run.

Out-of-scope follow-ups

The same antml:-only / no-namespace tag pattern is duplicated in several other spots (embedded-agent-utils.ts, reasoning-tag-text-partitioner.ts, auto-reply/tokens.ts, channels/progress-draft-compositor.ts, and the slack/imessage/matrix monitors). This PR fixes the two paths that produce the user-visible leak; consolidating these into a single shared tag-name constant would prevent future drift. Happy to extend this PR to cover them if preferred.

Related

Complements #89473 (MiniMax M3 reasoning tokens leaking to chat channels). That issue is about stripThinkingTagsFromText/sanitizeAssistantVisibleText not being applied as a final safety net on some delivery paths; this PR is the orthogonal half — making that sanitizer actually recognize MiniMax's mm:-namespaced tags (<mm:think>) so they are stripped once it runs. Both are needed to fully close the MiniMax leak. Also in the same reasoning-leak area: #90684, #87712.

@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 16, 2026
MiniMax M3 (e.g. via Fireworks) emits its chain-of-thought inline in the
content stream wrapped in `<mm:think>…</mm:think>` rather than in a separate
`reasoning_content` field. The reasoning-tag stripper only recognized the
`antml:` namespace, so `mm:`-namespaced tags slipped through QUICK_TAG_RE and
leaked the model's hidden reasoning into visible chat output.

Accept the `mm:` prefix alongside `antml:` in the shared sanitizer
(reasoning-tags.ts) and in the Telegram reasoning-lane coordinator's tag regex
and prefix list. Adds unit tests covering mm: think/thinking/thought blocks,
truncated-open orphan close recovery, and code-fence preservation.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@DrHack1
DrHack1 force-pushed the fix/minimax-mm-reasoning-tags branch from a8a20ae to c5e0dcb Compare June 16, 2026 20:04
@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 16, 2026
@clawsweeper

clawsweeper Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper review: did not complete due to Codex infrastructure failure. Reviewed June 16, 2026, 4:36 PM ET / 20:36 UTC.

Summary
Review failed before ClawSweeper could summarize the requested change.

PR surface: Source +6, Tests +15. Total +21 across 3 files.

Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path.

Review metrics: none identified.

Merge readiness
Not assessed.
Failure reason: invalid structured output.

This is a ClawSweeper/Codex infrastructure failure, not a PR readiness or patch-quality verdict.
Keep any merge decision on the normal maintainer review path until ClawSweeper can complete a fresh review.

Risk before merge

  • [P1] No close action taken because the review did not complete.

Maintainer options:

  1. Decide the mitigation before merge
    Retry the Codex review after fixing the execution failure.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • Review did not complete, so no work-lane recommendation was made.
Review details

Best possible solution:

Retry the Codex review after fixing the execution failure.

Do we have a high-confidence way to reproduce the issue?

Unclear. The review failed before ClawSweeper could establish a reproduction path.

Is this the best way to solve the issue?

Unclear. Retry the review first so ClawSweeper can evaluate the actual issue and fix direction.

AGENTS.md: unclear because the file could not be read completely.

Codex review notes: model internal, reasoning high; reviewed against d211d49011ba.

Evidence reviewed

PR surface:

Source +6, Tests +15. Total +21 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 9 3 +6
Tests 1 15 0 +15
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 24 3 +21

What I checked:

  • failure reason: invalid structured output.
  • codex failure detail: Codex review failed for this PR with exit 0 and wrote invalid JSON or schema-invalid output to /home/runner/work/clawsweeper/clawsweeper/artifacts/event/codex/93767.json: decision.rootCauseCluster.currentItemRelationship fixed_by_candidate requires a canonical PR.
  • codex stderr: No stderr captured.
  • codex stdout: in Telegram."}],"itemCategory":"bug","reproductionStatus":"source_reproducible","reproductionConfidence":"high","requiresNewFeature":false,"requiresNewConfigOption":false,"requiresProductDecision":false,"reproductionAssessment":"Yes. Source inspection shows current main’s shared sanitizer does not match <mm:think>, and the PR body supplies copied terminal output showing the stock artifact passes that tag through while the patched artifact strips it.","solutionAssessment":"No, not yet. Adding mm: to the shared sanitizer is the right core fix shape, but the Telegram duplicated partial-prefix grammar must cover the same variants and the Telegram streaming path still needs real proof.","visionFit":"not_applicable","visionFitReason":"This is a pull request review, so VISION.md product-fit classification is not applicable.","visionFitEvidence":[],"implementationComplexity":"not_applicable.

Likely related people:

  • unknown: Codex failed before it could trace repository history. (role: review did not complete; confidence: low)
How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@vincentkoc vincentkoc self-assigned this Jun 16, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Maintainer review and repair complete. This now handles MiniMax <think> / <analysis> reasoning tags consistently across complete text, streaming partitioning, embedded-agent subscriptions, Telegram streaming, and progress drafts.

Verification:

  • node scripts/run-vitest.mjs src/shared/text/reasoning-tags.test.ts src/shared/text/reasoning-tag-text-partitioner.test.ts src/agents/embedded-agent-utils.test.ts src/agents/embedded-agent-subscribe.subscribe-embedded-agent-session.emits-reasoning-as-separate-message-enabled.test.ts src/agents/embedded-agent-subscribe.subscribe-embedded-agent-session.subscribeembeddedagentsession.test.ts — 198 tests passed
  • pnpm exec oxfmt --check on touched files — passed
  • Fresh maintainer autoreview — clean, no accepted/actionable findings
  • pnpm check:changed via Crabbox Blacksmith Testbox — passed
    • provider: blacksmith-testbox
    • id: tbx_01kv95mnagphyvhj2j32n1tg51
    • slug: violet-crab
    • duration: 10m15s

Known proof gaps: none.

@vincentkoc
vincentkoc merged commit 4f860bf into openclaw:main Jun 16, 2026
181 of 184 checks passed
Alix-007 added a commit to Alix-007/openclaw that referenced this pull request Jun 17, 2026
…d stream gates

PR openclaw#93767 added MiniMax `mm:`-namespaced reasoning-tag support across the
shared sanitizer and Telegram lane coordinator, but two production reasoning-tag
recognizers were missed and still only matched the `antml:` namespace:

- src/auto-reply/tokens.ts: `taggedReasoningPrefixRe` / `openReasoningPrefixRe`
  drive `stripLeadingReasoningBlocks` and `isSilentReplyPayloadText`, which 14+
  call sites use to detect NO_REPLY silent payloads. A `<mm:think>…</mm:think>NO_REPLY`
  reply was not recognized as silent, leaking the wrapper into delivery.
- src/agents/embedded-agent-subscribe.handlers.messages.ts: `REASONING_TAG_RE`
  gates `shouldRecomputeFullStream`. A `<mm:think>` streaming chunk failed the
  test, so the visible stream was not recomputed and the hidden reasoning leaked.

Add the `mm:` alternative alongside `antml:` in all three regexes, matching the
exact `(?:antml:|mm:)?` form used by openclaw#93767. Identification-only change, no other
regex logic touched.
Alix-007 added a commit to Alix-007/openclaw that referenced this pull request Jun 17, 2026
…d stream gates

PR openclaw#93767 added MiniMax `mm:`-namespaced reasoning-tag support across the
shared sanitizer and Telegram lane coordinator, but two production reasoning-tag
recognizers were missed and still only matched the `antml:` namespace:

- src/auto-reply/tokens.ts: `taggedReasoningPrefixRe` / `openReasoningPrefixRe`
  drive `stripLeadingReasoningBlocks` and `isSilentReplyPayloadText`, which 14+
  call sites use to detect NO_REPLY silent payloads. A `<mm:think>…</mm:think>NO_REPLY`
  reply was not recognized as silent, leaking the wrapper into delivery.
- src/agents/embedded-agent-subscribe.handlers.messages.ts: `REASONING_TAG_RE`
  gates `shouldRecomputeFullStream`. A `<mm:think>` streaming chunk failed the
  test, so the visible stream was not recomputed and the hidden reasoning leaked.

Add the `mm:` alternative alongside `antml:` in all three regexes, matching the
exact `(?:antml:|mm:)?` form used by openclaw#93767. Identification-only change, no other
regex logic touched.
vincentkoc added a commit that referenced this pull request Jun 17, 2026
…ming paths missed by #93767 (#93806)

* fix(reasoning-tags): accept MiniMax mm: prefix in silent-detection and stream gates

PR #93767 added MiniMax `mm:`-namespaced reasoning-tag support across the
shared sanitizer and Telegram lane coordinator, but two production reasoning-tag
recognizers were missed and still only matched the `antml:` namespace:

- src/auto-reply/tokens.ts: `taggedReasoningPrefixRe` / `openReasoningPrefixRe`
  drive `stripLeadingReasoningBlocks` and `isSilentReplyPayloadText`, which 14+
  call sites use to detect NO_REPLY silent payloads. A `<mm:think>…</mm:think>NO_REPLY`
  reply was not recognized as silent, leaking the wrapper into delivery.
- src/agents/embedded-agent-subscribe.handlers.messages.ts: `REASONING_TAG_RE`
  gates `shouldRecomputeFullStream`. A `<mm:think>` streaming chunk failed the
  test, so the visible stream was not recomputed and the hidden reasoning leaked.

Add the `mm:` alternative alongside `antml:` in all three regexes, matching the
exact `(?:antml:|mm:)?` form used by #93767. Identification-only change, no other
regex logic touched.

* test(agents): cover MiniMax reasoning regressions

---------

Co-authored-by: Vincent Koc <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 17, 2026
…penclaw#93767)

* fix(reasoning-tags): strip MiniMax `mm:` namespaced reasoning tags

MiniMax M3 (e.g. via Fireworks) emits its chain-of-thought inline in the
content stream wrapped in `<mm:think>…</mm:think>` rather than in a separate
`reasoning_content` field. The reasoning-tag stripper only recognized the
`antml:` namespace, so `mm:`-namespaced tags slipped through QUICK_TAG_RE and
leaked the model's hidden reasoning into visible chat output.

Accept the `mm:` prefix alongside `antml:` in the shared sanitizer
(reasoning-tags.ts) and in the Telegram reasoning-lane coordinator's tag regex
and prefix list. Adds unit tests covering mm: think/thinking/thought blocks,
truncated-open orphan close recovery, and code-fence preservation.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* fix(reasoning): handle MiniMax tags in streams

---------

Co-authored-by: DrHack1 <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 17, 2026
…ming paths missed by openclaw#93767 (openclaw#93806)

* fix(reasoning-tags): accept MiniMax mm: prefix in silent-detection and stream gates

PR openclaw#93767 added MiniMax `mm:`-namespaced reasoning-tag support across the
shared sanitizer and Telegram lane coordinator, but two production reasoning-tag
recognizers were missed and still only matched the `antml:` namespace:

- src/auto-reply/tokens.ts: `taggedReasoningPrefixRe` / `openReasoningPrefixRe`
  drive `stripLeadingReasoningBlocks` and `isSilentReplyPayloadText`, which 14+
  call sites use to detect NO_REPLY silent payloads. A `<mm:think>…</mm:think>NO_REPLY`
  reply was not recognized as silent, leaking the wrapper into delivery.
- src/agents/embedded-agent-subscribe.handlers.messages.ts: `REASONING_TAG_RE`
  gates `shouldRecomputeFullStream`. A `<mm:think>` streaming chunk failed the
  test, so the visible stream was not recomputed and the hidden reasoning leaked.

Add the `mm:` alternative alongside `antml:` in all three regexes, matching the
exact `(?:antml:|mm:)?` form used by openclaw#93767. Identification-only change, no other
regex logic touched.

* test(agents): cover MiniMax reasoning regressions

---------

Co-authored-by: Vincent Koc <[email protected]>
crh-code pushed a commit to crh-code/openclaw that referenced this pull request Jun 18, 2026
…penclaw#93767)

* fix(reasoning-tags): strip MiniMax `mm:` namespaced reasoning tags

MiniMax M3 (e.g. via Fireworks) emits its chain-of-thought inline in the
content stream wrapped in `<mm:think>…</mm:think>` rather than in a separate
`reasoning_content` field. The reasoning-tag stripper only recognized the
`antml:` namespace, so `mm:`-namespaced tags slipped through QUICK_TAG_RE and
leaked the model's hidden reasoning into visible chat output.

Accept the `mm:` prefix alongside `antml:` in the shared sanitizer
(reasoning-tags.ts) and in the Telegram reasoning-lane coordinator's tag regex
and prefix list. Adds unit tests covering mm: think/thinking/thought blocks,
truncated-open orphan close recovery, and code-fence preservation.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* fix(reasoning): handle MiniMax tags in streams

---------

Co-authored-by: DrHack1 <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
crh-code pushed a commit to crh-code/openclaw that referenced this pull request Jun 18, 2026
…ming paths missed by openclaw#93767 (openclaw#93806)

* fix(reasoning-tags): accept MiniMax mm: prefix in silent-detection and stream gates

PR openclaw#93767 added MiniMax `mm:`-namespaced reasoning-tag support across the
shared sanitizer and Telegram lane coordinator, but two production reasoning-tag
recognizers were missed and still only matched the `antml:` namespace:

- src/auto-reply/tokens.ts: `taggedReasoningPrefixRe` / `openReasoningPrefixRe`
  drive `stripLeadingReasoningBlocks` and `isSilentReplyPayloadText`, which 14+
  call sites use to detect NO_REPLY silent payloads. A `<mm:think>…</mm:think>NO_REPLY`
  reply was not recognized as silent, leaking the wrapper into delivery.
- src/agents/embedded-agent-subscribe.handlers.messages.ts: `REASONING_TAG_RE`
  gates `shouldRecomputeFullStream`. A `<mm:think>` streaming chunk failed the
  test, so the visible stream was not recomputed and the hidden reasoning leaked.

Add the `mm:` alternative alongside `antml:` in all three regexes, matching the
exact `(?:antml:|mm:)?` form used by openclaw#93767. Identification-only change, no other
regex logic touched.

* test(agents): cover MiniMax reasoning regressions

---------

Co-authored-by: Vincent Koc <[email protected]>
Alix-007 added a commit to Alix-007/openclaw that referenced this pull request Jun 18, 2026
…tion guard

The iMessage reflection guard's THINKING_TAG_RE only matched bare
`<think>/<thought>` tags, so MiniMax's `<mm:think>` namespaced reasoning
tags (and Anthropic's `antml:` prefix) were not recognized as reflected
assistant content. When such reasoning leaked back inbound, the guard
treated it as a normal user message instead of dropping it, allowing
recursive echo amplification.

Accept the known reasoning-tag namespace prefixes `(?:antml:|mm:)?` on
the think/thought alternatives, mirroring the shared reasoning-tag
contract in src/shared/text/reasoning-tags.ts (PR openclaw#93767). This is the
remaining channel-monitor complement of openclaw#93767 for the iMessage path;
the optional prefix is a pure recognition enhancement with no change to
the bare-tag, code-region exemption, or other reflection patterns.

Verified by driving the real detectReflectedContent export:
  <mm:think>secret</mm:think>visible  -> isReflection=true (was false)
  <think>...</think>       -> isReflection=true
  <think>secret</think>                -> isReflection=true (no regression)
  "thinking about minimax algorithms"  -> isReflection=false (no false-positive)
  `<mm:think>x</mm:think>` in code     -> isReflection=false (code exemption kept)
zhangguiping-xydt added a commit to zhangguiping-xydt/openclaw that referenced this pull request Jun 20, 2026
…or replies

Mirrors openclaw#93874 (slack monitor) for the matrix extension. The matrix
reply delivery path checks shouldSuppressReasoningReplyText to drop
reasoning-only payloads before they reach the Matrix room; the
THINKING_TAG_RE / THINKING_BLOCK_RE patterns only matched bare,
antml:, or antthinking variants, so MiniMax <mm:think>…</mm:think>
payloads were treated as ordinary replies and the reasoning text was
sent into the Matrix room (a reasoning leak, not just a missed preview).

Align the regexes with src/shared/text/reasoning-tags.ts and openclaw#93767's
precedent by adding an optional (?:antml:|mm:)? prefix on
think/thinking/thought; antthinking is left unprefixed.

Adds a regression test that streams three mm: namespaced reasoning-only
replies and asserts only the visible answer reaches sendMessageMatrix.
steipete pushed a commit to Alix-007/openclaw that referenced this pull request Jun 30, 2026
…tion guard

The iMessage reflection guard's THINKING_TAG_RE only matched bare
`<think>/<thought>` tags, so MiniMax's `<mm:think>` namespaced reasoning
tags (and Anthropic's `antml:` prefix) were not recognized as reflected
assistant content. When such reasoning leaked back inbound, the guard
treated it as a normal user message instead of dropping it, allowing
recursive echo amplification.

Accept the known reasoning-tag namespace prefixes `(?:antml:|mm:)?` on
the think/thought alternatives, mirroring the shared reasoning-tag
contract in src/shared/text/reasoning-tags.ts (PR openclaw#93767). This is the
remaining channel-monitor complement of openclaw#93767 for the iMessage path;
the optional prefix is a pure recognition enhancement with no change to
the bare-tag, code-region exemption, or other reflection patterns.

Verified by driving the real detectReflectedContent export:
  <mm:think>secret</mm:think>visible  -> isReflection=true (was false)
  <think>...</think>       -> isReflection=true
  <think>secret</think>                -> isReflection=true (no regression)
  "thinking about minimax algorithms"  -> isReflection=false (no false-positive)
  `<mm:think>x</mm:think>` in code     -> isReflection=false (code exemption kept)
steipete pushed a commit to Alix-007/openclaw that referenced this pull request Jun 30, 2026
…tion guard

The iMessage reflection guard's THINKING_TAG_RE only matched bare
`<think>/<thought>` tags, so MiniMax's `<mm:think>` namespaced reasoning
tags (and Anthropic's `antml:` prefix) were not recognized as reflected
assistant content. When such reasoning leaked back inbound, the guard
treated it as a normal user message instead of dropping it, allowing
recursive echo amplification.

Accept the known reasoning-tag namespace prefixes `(?:antml:|mm:)?` on
the think/thought alternatives, mirroring the shared reasoning-tag
contract in src/shared/text/reasoning-tags.ts (PR openclaw#93767). This is the
remaining channel-monitor complement of openclaw#93767 for the iMessage path;
the optional prefix is a pure recognition enhancement with no change to
the bare-tag, code-region exemption, or other reflection patterns.

Verified by driving the real detectReflectedContent export:
  <mm:think>secret</mm:think>visible  -> isReflection=true (was false)
  <think>...</think>       -> isReflection=true
  <think>secret</think>                -> isReflection=true (no regression)
  "thinking about minimax algorithms"  -> isReflection=false (no false-positive)
  `<mm:think>x</mm:think>` in code     -> isReflection=false (code exemption kept)
steipete pushed a commit to Alix-007/openclaw that referenced this pull request Jun 30, 2026
…tion guard

The iMessage reflection guard's THINKING_TAG_RE only matched bare
`<think>/<thought>` tags, so MiniMax's `<mm:think>` namespaced reasoning
tags (and Anthropic's `antml:` prefix) were not recognized as reflected
assistant content. When such reasoning leaked back inbound, the guard
treated it as a normal user message instead of dropping it, allowing
recursive echo amplification.

Accept the known reasoning-tag namespace prefixes `(?:antml:|mm:)?` on
the think/thought alternatives, mirroring the shared reasoning-tag
contract in src/shared/text/reasoning-tags.ts (PR openclaw#93767). This is the
remaining channel-monitor complement of openclaw#93767 for the iMessage path;
the optional prefix is a pure recognition enhancement with no change to
the bare-tag, code-region exemption, or other reflection patterns.

Verified by driving the real detectReflectedContent export:
  <mm:think>secret</mm:think>visible  -> isReflection=true (was false)
  <think>...</think>       -> isReflection=true
  <think>secret</think>                -> isReflection=true (no regression)
  "thinking about minimax algorithms"  -> isReflection=false (no false-positive)
  `<mm:think>x</mm:think>` in code     -> isReflection=false (code exemption kept)
steipete pushed a commit that referenced this pull request Jun 30, 2026
…rd (completes #93767) (#93820)

* fix(imessage): detect MiniMax mm: namespaced reasoning tags in reflection guard

The iMessage reflection guard's THINKING_TAG_RE only matched bare
`<think>/<thought>` tags, so MiniMax's `<mm:think>` namespaced reasoning
tags (and Anthropic's `antml:` prefix) were not recognized as reflected
assistant content. When such reasoning leaked back inbound, the guard
treated it as a normal user message instead of dropping it, allowing
recursive echo amplification.

Accept the known reasoning-tag namespace prefixes `(?:antml:|mm:)?` on
the think/thought alternatives, mirroring the shared reasoning-tag
contract in src/shared/text/reasoning-tags.ts (PR #93767). This is the
remaining channel-monitor complement of #93767 for the iMessage path;
the optional prefix is a pure recognition enhancement with no change to
the bare-tag, code-region exemption, or other reflection patterns.

Verified by driving the real detectReflectedContent export:
  <mm:think>secret</mm:think>visible  -> isReflection=true (was false)
  <think>...</think>       -> isReflection=true
  <think>secret</think>                -> isReflection=true (no regression)
  "thinking about minimax algorithms"  -> isReflection=false (no false-positive)
  `<mm:think>x</mm:think>` in code     -> isReflection=false (code exemption kept)

* chore: retrigger CI for real behavior proof check

* refactor(imessage): tighten reflection guard coverage

---------

Co-authored-by: Peter Steinberger <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 1, 2026
…rd (completes openclaw#93767) (openclaw#93820)

* fix(imessage): detect MiniMax mm: namespaced reasoning tags in reflection guard

The iMessage reflection guard's THINKING_TAG_RE only matched bare
`<think>/<thought>` tags, so MiniMax's `<mm:think>` namespaced reasoning
tags (and Anthropic's `antml:` prefix) were not recognized as reflected
assistant content. When such reasoning leaked back inbound, the guard
treated it as a normal user message instead of dropping it, allowing
recursive echo amplification.

Accept the known reasoning-tag namespace prefixes `(?:antml:|mm:)?` on
the think/thought alternatives, mirroring the shared reasoning-tag
contract in src/shared/text/reasoning-tags.ts (PR openclaw#93767). This is the
remaining channel-monitor complement of openclaw#93767 for the iMessage path;
the optional prefix is a pure recognition enhancement with no change to
the bare-tag, code-region exemption, or other reflection patterns.

Verified by driving the real detectReflectedContent export:
  <mm:think>secret</mm:think>visible  -> isReflection=true (was false)
  <think>...</think>       -> isReflection=true
  <think>secret</think>                -> isReflection=true (no regression)
  "thinking about minimax algorithms"  -> isReflection=false (no false-positive)
  `<mm:think>x</mm:think>` in code     -> isReflection=false (code exemption kept)

* chore: retrigger CI for real behavior proof check

* refactor(imessage): tighten reflection guard coverage

---------

Co-authored-by: Peter Steinberger <[email protected]>
QiuYuang pushed a commit to QiuYuang/openclaw that referenced this pull request Jul 1, 2026
…rd (completes openclaw#93767) (openclaw#93820)

* fix(imessage): detect MiniMax mm: namespaced reasoning tags in reflection guard

The iMessage reflection guard's THINKING_TAG_RE only matched bare
`<think>/<thought>` tags, so MiniMax's `<mm:think>` namespaced reasoning
tags (and Anthropic's `antml:` prefix) were not recognized as reflected
assistant content. When such reasoning leaked back inbound, the guard
treated it as a normal user message instead of dropping it, allowing
recursive echo amplification.

Accept the known reasoning-tag namespace prefixes `(?:antml:|mm:)?` on
the think/thought alternatives, mirroring the shared reasoning-tag
contract in src/shared/text/reasoning-tags.ts (PR openclaw#93767). This is the
remaining channel-monitor complement of openclaw#93767 for the iMessage path;
the optional prefix is a pure recognition enhancement with no change to
the bare-tag, code-region exemption, or other reflection patterns.

Verified by driving the real detectReflectedContent export:
  <mm:think>secret</mm:think>visible  -> isReflection=true (was false)
  <think>...</think>       -> isReflection=true
  <think>secret</think>                -> isReflection=true (no regression)
  "thinking about minimax algorithms"  -> isReflection=false (no false-positive)
  `<mm:think>x</mm:think>` in code     -> isReflection=false (code exemption kept)

* chore: retrigger CI for real behavior proof check

* refactor(imessage): tighten reflection guard coverage

---------

Co-authored-by: Peter Steinberger <[email protected]>
chenyangjun-xy pushed a commit to chenyangjun-xy/openclaw that referenced this pull request Jul 1, 2026
…rd (completes openclaw#93767) (openclaw#93820)

* fix(imessage): detect MiniMax mm: namespaced reasoning tags in reflection guard

The iMessage reflection guard's THINKING_TAG_RE only matched bare
`<think>/<thought>` tags, so MiniMax's `<mm:think>` namespaced reasoning
tags (and Anthropic's `antml:` prefix) were not recognized as reflected
assistant content. When such reasoning leaked back inbound, the guard
treated it as a normal user message instead of dropping it, allowing
recursive echo amplification.

Accept the known reasoning-tag namespace prefixes `(?:antml:|mm:)?` on
the think/thought alternatives, mirroring the shared reasoning-tag
contract in src/shared/text/reasoning-tags.ts (PR openclaw#93767). This is the
remaining channel-monitor complement of openclaw#93767 for the iMessage path;
the optional prefix is a pure recognition enhancement with no change to
the bare-tag, code-region exemption, or other reflection patterns.

Verified by driving the real detectReflectedContent export:
  <mm:think>secret</mm:think>visible  -> isReflection=true (was false)
  <think>...</think>       -> isReflection=true
  <think>secret</think>                -> isReflection=true (no regression)
  "thinking about minimax algorithms"  -> isReflection=false (no false-positive)
  `<mm:think>x</mm:think>` in code     -> isReflection=false (code exemption kept)

* chore: retrigger CI for real behavior proof check

* refactor(imessage): tighten reflection guard coverage

---------

Co-authored-by: Peter Steinberger <[email protected]>
chenyangjun-xy pushed a commit to chenyangjun-xy/openclaw that referenced this pull request Jul 3, 2026
…rd (completes openclaw#93767) (openclaw#93820)

* fix(imessage): detect MiniMax mm: namespaced reasoning tags in reflection guard

The iMessage reflection guard's THINKING_TAG_RE only matched bare
`<think>/<thought>` tags, so MiniMax's `<mm:think>` namespaced reasoning
tags (and Anthropic's `antml:` prefix) were not recognized as reflected
assistant content. When such reasoning leaked back inbound, the guard
treated it as a normal user message instead of dropping it, allowing
recursive echo amplification.

Accept the known reasoning-tag namespace prefixes `(?:antml:|mm:)?` on
the think/thought alternatives, mirroring the shared reasoning-tag
contract in src/shared/text/reasoning-tags.ts (PR openclaw#93767). This is the
remaining channel-monitor complement of openclaw#93767 for the iMessage path;
the optional prefix is a pure recognition enhancement with no change to
the bare-tag, code-region exemption, or other reflection patterns.

Verified by driving the real detectReflectedContent export:
  <mm:think>secret</mm:think>visible  -> isReflection=true (was false)
  <think>...</think>       -> isReflection=true
  <think>secret</think>                -> isReflection=true (no regression)
  "thinking about minimax algorithms"  -> isReflection=false (no false-positive)
  `<mm:think>x</mm:think>` in code     -> isReflection=false (code exemption kept)

* chore: retrigger CI for real behavior proof check

* refactor(imessage): tighten reflection guard coverage

---------

Co-authored-by: Peter Steinberger <[email protected]>
Rorqualx pushed a commit to Rorqualx/cortex that referenced this pull request Jul 6, 2026
…rd (completes openclaw#93767) (openclaw#93820)

* fix(imessage): detect MiniMax mm: namespaced reasoning tags in reflection guard

The iMessage reflection guard's THINKING_TAG_RE only matched bare
`<think>/<thought>` tags, so MiniMax's `<mm:think>` namespaced reasoning
tags (and Anthropic's `antml:` prefix) were not recognized as reflected
assistant content. When such reasoning leaked back inbound, the guard
treated it as a normal user message instead of dropping it, allowing
recursive echo amplification.

Accept the known reasoning-tag namespace prefixes `(?:antml:|mm:)?` on
the think/thought alternatives, mirroring the shared reasoning-tag
contract in src/shared/text/reasoning-tags.ts (PR openclaw#93767). This is the
remaining channel-monitor complement of openclaw#93767 for the iMessage path;
the optional prefix is a pure recognition enhancement with no change to
the bare-tag, code-region exemption, or other reflection patterns.

Verified by driving the real detectReflectedContent export:
  <mm:think>secret</mm:think>visible  -> isReflection=true (was false)
  <think>...</think>       -> isReflection=true
  <think>secret</think>                -> isReflection=true (no regression)
  "thinking about minimax algorithms"  -> isReflection=false (no false-positive)
  `<mm:think>x</mm:think>` in code     -> isReflection=false (code exemption kept)

* chore: retrigger CI for real behavior proof check

* refactor(imessage): tighten reflection guard coverage

---------

Co-authored-by: Peter Steinberger <[email protected]>
(cherry picked from commit 076da56)
sheyanmin added a commit to sheyanmin/openclaw that referenced this pull request Jul 8, 2026
…eplies

The THINKING_TAG_RE and THINKING_BLOCK_RE regex patterns in the Matrix
monitor replies module were missing the mm: namespace prefix for detecting
MiniMax reasoning tags. This caused mm:think/mm:thought reasoning content
to leak into Matrix room messages.

Add (?:antml:|mm:)? prefix to think(?:ing)?|thought alternatives in both
regexes, consistent with the pattern already applied in reasoning-tags.ts
and other channel modules (see openclaw#93767, openclaw#93806, openclaw#93820).

Fixes openclaw#99412
sheyanmin added a commit to sheyanmin/openclaw that referenced this pull request Jul 8, 2026
…eplies

The THINKING_TAG_RE and THINKING_BLOCK_RE regex patterns in the Matrix
monitor replies module were missing the mm: namespace prefix for detecting
MiniMax reasoning tags. This caused mm:think/mm:thought reasoning content
to leak into Matrix room messages.

Add (?:antml:|mm:)? prefix to think(?:ing)?|thought alternatives in both
regexes, consistent with the pattern already applied in reasoning-tags.ts
and other channel modules (see openclaw#93767, openclaw#93806, openclaw#93820).

Fixes openclaw#99412
Rorqualx pushed a commit to Rorqualx/cortex that referenced this pull request Jul 8, 2026
…rd (completes openclaw#93767) (openclaw#93820)

* fix(imessage): detect MiniMax mm: namespaced reasoning tags in reflection guard

The iMessage reflection guard's THINKING_TAG_RE only matched bare
`<think>/<thought>` tags, so MiniMax's `<mm:think>` namespaced reasoning
tags (and Anthropic's `antml:` prefix) were not recognized as reflected
assistant content. When such reasoning leaked back inbound, the guard
treated it as a normal user message instead of dropping it, allowing
recursive echo amplification.

Accept the known reasoning-tag namespace prefixes `(?:antml:|mm:)?` on
the think/thought alternatives, mirroring the shared reasoning-tag
contract in src/shared/text/reasoning-tags.ts (PR openclaw#93767). This is the
remaining channel-monitor complement of openclaw#93767 for the iMessage path;
the optional prefix is a pure recognition enhancement with no change to
the bare-tag, code-region exemption, or other reflection patterns.

Verified by driving the real detectReflectedContent export:
  <mm:think>secret</mm:think>visible  -> isReflection=true (was false)
  <think>...</think>       -> isReflection=true
  <think>secret</think>                -> isReflection=true (no regression)
  "thinking about minimax algorithms"  -> isReflection=false (no false-positive)
  `<mm:think>x</mm:think>` in code     -> isReflection=false (code exemption kept)

* chore: retrigger CI for real behavior proof check

* refactor(imessage): tighten reflection guard coverage

---------

Co-authored-by: Peter Steinberger <[email protected]>
(cherry picked from commit 076da56)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: telegram Channel integration: telegram proof: supplied External PR includes structured after-fix real behavior proof. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants