fix(imessage): recognize MiniMax mm: reasoning tags in reflection guard (completes #93767)#93820
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 30, 2026, 3:28 PM ET / 19:28 UTC. Summary PR surface: Source +3, Tests +9. Total +12 across 2 files. Reproducibility: yes. Current main and Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the narrow iMessage guard alignment after maintainer acceptance of the known-tag suppression boundary, while leaving broader cross-channel reasoning taxonomy cleanup with #89473. Do we have a high-confidence way to reproduce the issue? Yes. Current main and Is this the best way to solve the issue? Yes. The iMessage plugin owns this inbound reflection guard, and aligning its local matcher with the existing shared reasoning-tag contract is the narrow fix; a shared matcher is a broader follow-up, not a blocker. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5a89484eb31d. Label changesLabel justifications:
Evidence reviewedPR surface: Source +3, Tests +9. Total +12 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
2b7eba4 to
a57ec19
Compare
|
@clawsweeper re-review — Added a Real behavior proof section. It drives the real |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review — Added the |
|
@clawsweeper re-review — Updated the PR body with a machine-readable |
bde8976 to
08df499
Compare
…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)
08df499 to
53eb0ed
Compare
|
Land-ready maintainer pass on exact head
No live iMessage device round trip was run; the changed boundary is a deterministic parser used directly by the inbound decision path. |
|
Merged via squash.
|
…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]>
…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]>
…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]>
…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]>
…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)
…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
…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
…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)
What Problem This Solves
The iMessage reflection guard (
extensions/imessage/src/monitor/reflection-guard.ts) failed to recognize MiniMaxmm:-namespaced reasoning tags (<mm:think>,<mm:thinking>,<mm:thought>). ItsTHINKING_TAG_REonly matched bare/antthinkingreasoning tags, so a MiniMax reply carrying<mm:think>…</mm:think>was not treated as reflected assistant reasoning. BecausedetectReflectedContentfeeds the inbound drop decision (inbound-processing.ts:718), any user on a MiniMax-backed agent would have the model's internal reasoning leak through to the iMessage thread (and risk echo-amplification) instead of being suppressed. This continues the cleanup flagged by #93767, which addedmm:support to the central reasoning-tag handling and noted the same pattern was duplicated in other monitor paths — this guard was one of them (it was missing even theantml:prefix).Evidence
Driven against the real exported
detectReflectedContent(no mocks — it is a deterministic function and importing it exercises the exact code pathinbound-processing.ts:718uses), local, Node v22.22.0,node --import tsx:"<mm:think>secret reasoning</mm:think>visible"→isReflection=true,labels=["thinking-tag"], content suppressed before reaching the downstream inbound pipeline.<mm:thinking>/<mm:thought>variants all flagged too.<think>/<thinking>tags stillisReflection=true;mm:thinkinside inline code stillisReflection=false(code-fence exemption preserved); the phrase"thinking about your minimax question"stillisReflection=false(no misclassification).isReflection=false— the reasoning is delivered downstream (leaks past the guard); restoring the fix returns it to suppressed. This pins the behavior change to exactly this patch.reflection-guard.test.ts→ 20 pass, including the 2 new namespaced cases (Anthropic<think>and MiniMax<mm:think>).oxlint+oxfmt --checkclean.Summary
#93767 added MiniMax
mm:namespace support to reasoning-tag handling, and its own follow-up note flagged that the same tag pattern is duplicated in several other monitor paths. The iMessage reflection guard is one of them:THINKING_TAG_REinextensions/imessage/src/monitor/reflection-guard.ts:7only matched bare/antthinkingreasoning tags, so a MiniMax<mm:think>…</mm:think>reply was not recognized as reflected reasoning.detectReflectedContentfeeds the inbound drop decision (inbound-processing.ts:718), so unrecognized MiniMax reasoning slips through reflection detection and can be echo-amplified.Changes
extensions/imessage/src/monitor/reflection-guard.ts:(?:think(?:ing)?|thought|antthinking)→(?:(?:antml:|mm:)?(?:think(?:ing)?|thought)|antthinking), matching fix(reasoning-tags): strip MiniMaxmm:namespaced reasoning tags #93767's exact pattern (this guard had been missing evenantml:— aligned to the shared reasoning-tag contract fix(reasoning-tags): strip MiniMaxmm:namespaced reasoning tags #93767 established). +8/-1 + 2 regression tests.Real behavior proof
Behavior addressed: the iMessage reflection guard recognizes MiniMax
mm:-namespaced reasoning tags (<mm:think>,<mm:thinking>,<mm:thought>) the same as bare ones, so MiniMax reasoning is suppressed by the inbound reflection guard instead of being forwarded downstream.Real environment tested: local, Node v22.22.0,
node --import tsx, driving the real exporteddetectReflectedContentfrom the changed file (which uses the realopenclaw/plugin-sdk/text-chunkingcode-region logic). No mocks — this is a deterministic reflection-detection function, so importing it exercises the exact production code pathinbound-processing.ts:718relies on. A downstream-delivery wrapper models the readback boundary ("what actually reaches the downstream inbound pipeline": a flagged reflection is suppressed; an unflagged one is delivered/leaks).Exact steps or command run after this patch:
Evidence after fix (real function output):
Observed result after fix: MiniMax
<mm:think>…</mm:think>content is now flagged as a reflection (isReflection=true, labelthinking-tag) and suppressed before reaching the downstream inbound pipeline; bare-tag and code-fence-exemption behavior is unchanged.reflection-guard.test.ts: 20 pass (incl. 2 new namespaced cases).oxlint+oxfmt --checkclean.Negative control: reverting only the source regex to its pre-fix form (
git show <parent>:reflection-guard.ts) and re-running the same proof flips the MiniMax case toisReflection=false—"<mm:think>secret reasoning</mm:think>visible"is delivered downstream (leaks past the guard) instead of being suppressed; restoring the fix returns it to suppressed. This pins the behavior change to exactly this patch.What was not tested: no live iMessage round-trip; the change is in the deterministic reflection-detection regex, driven via the real exported function.
Real behavior proof
Behavior addressed: The iMessage reflection guard did not recognize MiniMax mm: namespaced reasoning tags such as mm:think, mm:thinking, and mm:thought. This patch makes the guard flag those tags as reflected reasoning so they are suppressed instead of being forwarded downstream.
Real environment tested: Local Linux runtime with Node v22.22.0 and node --import tsx, driving the real exported detectReflectedContent from extensions/imessage/src/monitor/reflection-guard.ts. The function imports and uses the real openclaw/plugin-sdk text-chunking code-region logic. A small downstream-delivery wrapper read back whether flagged content would be suppressed or delivered.
Exact steps or command run after this patch: In PR head fork/fix/minimax-mm-channel-monitor-guards, ran node --import tsx proof.mts to drive real detectReflectedContent, then ran node scripts/run-vitest.mjs extensions/imessage/src/monitor/reflection-guard.test.ts --run.
Evidence after fix: Live terminal output from the proof script:
Negative control reverting only the source regex to the pre-fix form flipped the MiniMax case to isReflection=false and delivered the mm:think content downstream; restoring the fix suppressed it again.
Observed result after fix: MiniMax mm:think...</mm:think> content is now flagged as a reflection with label thinking-tag and suppressed before reaching the downstream inbound pipeline. Bare-tag behavior and code-fence exemption behavior remain unchanged. reflection-guard.test.ts passed 20 tests, with oxlint and oxfmt --check clean.
What was not tested: No live iMessage round trip was run. The changed behavior is a deterministic reflection-detection regex and was driven through the real exported function rather than a phone/device integration.