Skip to content

fix(imessage): recognize MiniMax mm: reasoning tags in reflection guard (completes #93767)#93820

Merged
steipete merged 3 commits into
openclaw:mainfrom
Alix-007:fix/minimax-mm-channel-monitor-guards
Jun 30, 2026
Merged

fix(imessage): recognize MiniMax mm: reasoning tags in reflection guard (completes #93767)#93820
steipete merged 3 commits into
openclaw:mainfrom
Alix-007:fix/minimax-mm-channel-monitor-guards

Conversation

@Alix-007

@Alix-007 Alix-007 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

The iMessage reflection guard (extensions/imessage/src/monitor/reflection-guard.ts) failed to recognize MiniMax mm:-namespaced reasoning tags (<mm:think>, <mm:thinking>, <mm:thought>). Its THINKING_TAG_RE only matched bare/antthinking reasoning tags, so a MiniMax reply carrying <mm:think>…</mm:think> was not treated as reflected assistant reasoning. Because detectReflectedContent feeds 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 added mm: 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 the antml: prefix).

Evidence

Driven against the real exported detectReflectedContent (no mocks — it is a deterministic function and importing it exercises the exact code path inbound-processing.ts:718 uses), local, Node v22.22.0, node --import tsx:

  • After fix: "<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.
  • No regression: bare <think>/<thinking> tags still isReflection=true; mm:think inside inline code still isReflection=false (code-fence exemption preserved); the phrase "thinking about your minimax question" still isReflection=false (no misclassification).
  • Negative control: reverting only the source regex to its pre-fix form and re-running the same proof flips the MiniMax case to 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.
  • Tests: reflection-guard.test.ts20 pass, including the 2 new namespaced cases (Anthropic <think> and MiniMax <mm:think>). oxlint + oxfmt --check clean.

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_RE in extensions/imessage/src/monitor/reflection-guard.ts:7 only matched bare/antthinking reasoning tags, so a MiniMax <mm:think>…</mm:think> reply was not recognized as reflected reasoning. detectReflectedContent feeds the inbound drop decision (inbound-processing.ts:718), so unrecognized MiniMax reasoning slips through reflection detection and can be echo-amplified.

Changes

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 exported detectReflectedContent from the changed file (which uses the real openclaw/plugin-sdk/text-chunking code-region logic). No mocks — this is a deterministic reflection-detection function, so importing it exercises the exact production code path inbound-processing.ts:718 relies 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:

git worktree add -f /tmp/pwt fork/fix/minimax-mm-channel-monitor-guards
cd /tmp/pwt && node --import tsx proof.mts            # drives real detectReflectedContent
node scripts/run-vitest.mjs extensions/imessage/src/monitor/reflection-guard.test.ts --run

Evidence after fix (real function output):

[PASS] MiniMax mm: namespaced reasoning tag
       input="<mm:think>secret reasoning</mm:think>visible"
       isReflection=true  labels=["thinking-tag"]
       downstream delivered=<suppressed by guard>
[PASS] bare <think>/<thinking> tags         -> isReflection=true  (no regression)
[PASS] mm:think inside inline code           -> isReflection=false (code-fence exemption preserved)
[PASS] "thinking about your minimax question"-> isReflection=false (no misclassification)
<mm:thinking>/<mm:thought> variants          -> isReflection=true  (all mm: forms covered)

Observed result after fix: MiniMax <mm:think>…</mm:think> content is now flagged as a reflection (isReflection=true, label thinking-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 --check clean.

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 to isReflection=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:

[PASS] MiniMax mm: namespaced reasoning tag
       input="<mm:think>secret reasoning</mm:think>visible"
       isReflection=true  labels=["thinking-tag"]
       downstream delivered=<suppressed by guard>
[PASS] bare <think>/<thinking> tags         -> isReflection=true  (no regression)
[PASS] mm:think inside inline code           -> isReflection=false (code-fence exemption preserved)
[PASS] "thinking about your minimax question"-> isReflection=false (no misclassification)
<mm:thinking>/<mm:thought> variants          -> isReflection=true  (all mm: forms covered)

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.

@openclaw-barnacle openclaw-barnacle Bot added channel: imessage Channel integration: imessage size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 17, 2026
@clawsweeper

clawsweeper Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 30, 2026, 3:28 PM ET / 19:28 UTC.

Summary
The PR broadens the iMessage reflection guard's thinking-tag regex to recognize antml: and mm: namespaced reasoning tags and adds table-driven regression tests.

PR surface: Source +3, Tests +9. Total +12 across 2 files.

Reproducibility: yes. Current main and v2026.6.11 do not match mm: namespaced tags in the iMessage reflection guard, and the inbound caller drops only when that guard returns a reflection result; I did not run tests in this read-only review.

Review metrics: 1 noteworthy metric.

  • Drop classifier change: 1 regex broadened. The changed regex controls which inbound iMessage texts are suppressed before reaching the agent pipeline.

Root-cause cluster
Relationship: canonical
Canonical: #93820
Summary: This PR is the canonical open iMessage branch for the MiniMax namespaced reasoning-tag reflection-guard gap; related items cover shared, source, Slack, Matrix, and broader reasoning-leak slices.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Risk before merge

  • [P1] The broadened iMessage classifier will drop non-code inbound messages containing known antml: or mm: reasoning markup before agent processing, so maintainers should explicitly accept that message-delivery tradeoff.
  • [P1] The proof is strong parser/drop-boundary output with a negative control, but it is not a live iMessage device round trip.

Maintainer options:

  1. Accept Known-Tag Suppression (recommended)
    Land the PR after explicitly accepting that iMessage will now suppress non-code inbound messages containing the known assistant reasoning tags as reflected content.
  2. Ask For Live iMessage Proof
    Request a short iMessage monitor or device-boundary proof if deterministic parser and caller evidence is not enough for this classifier change.
  3. Pause For Shared Matcher Consolidation
    Hold or close this branch only if maintainers want a shared plugin-SDK reasoning-tag matcher before accepting another channel-local regex alignment.

Next step before merge

  • No automated repair remains; maintainers should decide whether to accept the iMessage drop-classifier expansion and whether deterministic proof is enough before merge.

Security
Cleared: The diff changes only a local iMessage regex and focused tests, with no dependency, workflow, secret, permission, or supply-chain changes.

Review details

Best 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 v2026.6.11 do not match mm: namespaced tags in the iMessage reflection guard, and the inbound caller drops only when that guard returns a reflection result; I did not run tests in this read-only review.

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 changes

Label justifications:

  • P2: This is a normal-priority iMessage-specific bug fix with limited blast radius but real message-delivery impact.
  • merge-risk: 🚨 message-delivery: The diff changes which inbound iMessage texts are classified as reflected assistant content and dropped before the agent pipeline.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes live output from the real exported reflection parser plus a negative control; no live iMessage round trip was run, but the changed behavior is deterministic and at the production drop boundary.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes live output from the real exported reflection parser plus a negative control; no live iMessage round trip was run, but the changed behavior is deterministic and at the production drop boundary.
Evidence reviewed

PR surface:

Source +3, Tests +9. Total +12 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 4 1 +3
Tests 1 9 0 +9
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 13 1 +12

What I checked:

Likely related people:

  • joelnishanth: Authored the merged iMessage echo-loop hardening PR that introduced the reflection guard and inbound reflected-content drop behavior now being adjusted. (role: introduced behavior; confidence: high; commits: adb9234d0375; files: src/imessage/monitor/reflection-guard.ts, src/imessage/monitor/inbound-processing.ts)
  • scoootscooob: Moved the iMessage implementation into extensions/imessage, establishing the current plugin-owned paths touched by this PR. (role: owner-boundary refactor contributor; confidence: high; commits: 0ce23dc62d37; files: extensions/imessage/src/monitor/reflection-guard.ts, extensions/imessage/src/monitor/inbound-processing.ts)
  • DrHack1: Authored the merged shared MiniMax mm: reasoning-tag support that this PR aligns the iMessage guard with. (role: recent related contract contributor; confidence: medium; commits: 4f860bfab09c; files: src/shared/text/reasoning-tags.ts, extensions/telegram/src/reasoning-lane-coordinator.ts)
  • Alix-007: Beyond this PR, authored merged follow-ups for MiniMax mm: recognition in sibling silent-reply, streaming, and Slack monitor paths. (role: recent related follow-up contributor; confidence: high; commits: f8e7d66ae6b0, d2bf67f4b709; files: src/auto-reply/tokens.ts, src/agents/embedded-agent-subscribe.handlers.messages.ts, extensions/slack/src/monitor/message-handler/dispatch.ts)
  • steipete: Is assigned to this PR and authored the latest branch refactor commit tightening the iMessage coverage shape. (role: current reviewer and branch refactor author; confidence: medium; commits: 53eb0ed7c871; files: extensions/imessage/src/monitor/reflection-guard.ts, extensions/imessage/src/monitor/reflection-guard.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • 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.

@Alix-007
Alix-007 force-pushed the fix/minimax-mm-channel-monitor-guards branch from 2b7eba4 to a57ec19 Compare June 18, 2026 02:14
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jun 19, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jun 20, 2026
@Alix-007

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review — Added a Real behavior proof section. It drives the real detectReflectedContent reflection guard; post-patch a <mm:think> namespaced reasoning tag is detected and suppressed (not delivered downstream), while a negative control on the pre-patch regex lets the mm: reasoning leak past the guard. Bare tags and code-fence exemptions unchanged. Vitest (20 tests) passes.

@clawsweeper

clawsweeper Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jun 20, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jun 21, 2026
@Alix-007

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review — Added the What Problem This Solves and Evidence headings the proof workflow expects (proof content unchanged, just restructured under the required sections). This should clear needs-pr-context.

@clawsweeper clawsweeper Bot added status: 🔁 re-review loop A fresh ClawSweeper review was explicitly requested after the latest review. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 21, 2026
@Alix-007

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review — Updated the PR body with a machine-readable ## Real behavior proof section using the exact field names required by the current proof policy. I verified the updated body locally against evaluateRealBehaviorProof and the latest GitHub Real behavior proof check is now passing.

@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: 🔁 re-review loop A fresh ClawSweeper review was explicitly requested after the latest review. labels Jun 23, 2026
@steipete steipete self-assigned this Jun 30, 2026
@steipete
steipete force-pushed the fix/minimax-mm-channel-monitor-guards branch 2 times, most recently from bde8976 to 08df499 Compare June 30, 2026 19:13
Alix-007 and others added 3 commits June 30, 2026 12:22
…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
steipete force-pushed the fix/minimax-mm-channel-monitor-guards branch from 08df499 to 53eb0ed Compare June 30, 2026 19:22
@steipete

Copy link
Copy Markdown
Contributor

Land-ready maintainer pass on exact head 53eb0ed7c8710b18494fad63c9c3378ce8b9610a:

  • Tightened the new invariant comment and table-drove the duplicate namespace cases; final diff is +13/-1 across the guard and its tests.
  • Focused proof: node scripts/run-vitest.mjs extensions/imessage/src/monitor/reflection-guard.test.ts — 1 file, 20 tests passed.
  • Direct runtime proof: antml:think, mm:think, mm:thinking, and mm:thought classify as thinking-tag; inline-code and normal-prose controls remain unclassified.
  • Fresh autoreview: clean, no accepted/actionable findings (0.99 confidence).
  • Exact-head hosted CI: run 28470084930, all relevant checks green. Its unrelated otel-trace-smoke QA failure passed on a single-job rerun.
  • Repository landing verifier: exact-head hosted CI/Testbox gates passed.

No live iMessage device round trip was run; the changed boundary is a deterministic parser used directly by the inbound decision path.

@steipete
steipete merged commit 076da56 into openclaw:main Jun 30, 2026
140 of 141 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

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

channel: imessage Channel integration: imessage merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants