Skip to content

fix(imessage): detect namespaced thinking reflections#95690

Closed
Pick-cat wants to merge 1 commit into
openclaw:mainfrom
Pick-cat:fix-imessage-namespaced-thinking-reflection
Closed

fix(imessage): detect namespaced thinking reflections#95690
Pick-cat wants to merge 1 commit into
openclaw:mainfrom
Pick-cat:fix-imessage-namespaced-thinking-reflection

Conversation

@Pick-cat

Copy link
Copy Markdown
Contributor

What Problem This Solves

iMessage's reflection guard had a local thinking-tag detector that recognized bare <think> / <thinking> / <thought> tags, but not the namespaced forms already handled by the shared reasoning-tag helper and Slack path. Reflected assistant content containing <mm:think>...</mm:think> or <antml:thinking>...</antml:thinking> could therefore bypass detectReflectedContent() and continue through inbound processing.

Why This Change Was Made

extensions/imessage/src/monitor/inbound-processing.ts drops inbound messages when detectReflectedContent() identifies assistant-internal markers. The detector in extensions/imessage/src/monitor/reflection-guard.ts kept a local thinking-tag regex that had not picked up the known mm: and antml: namespace prefixes. This change aligns that detector with the shared/Slack thinking tag family while preserving the existing requirement for a complete tag close bracket.

User Impact

iMessage users get stronger loop/reflection protection for model outputs that use MiniMax or Anthropic-style namespaced thinking tags. Normal user text and code examples remain protected by the existing code-region checks.

Evidence

  • Verified the bug exists on current main (8e76feb482): temporarily added the same regression assertions to extensions/imessage/src/monitor/reflection-guard.test.ts and ran node scripts/run-vitest.mjs extensions/imessage/src/monitor/reflection-guard.test.ts.
  • Result on main: failed as expected. detectReflectedContent("<mm:think>internal reasoning</mm:think>").isReflection returned false.
  • Ran the same command on this branch after the fix: passed, 1 test file / 19 tests.
  • git diff --check passed.
  • .agents/skills/autoreview/scripts/autoreview --mode local passed with no accepted/actionable findings.

@openclaw-barnacle openclaw-barnacle Bot added channel: imessage Channel integration: imessage size: XS labels Jun 22, 2026
@Pick-cat

Copy link
Copy Markdown
Contributor Author

Closing this as superseded by the existing iMessage canonical branch: #93820.

I rechecked both diffs. This PR and #93820 make the same production change in extensions/imessage/src/monitor/reflection-guard.ts: the local thinking-tag detector accepts the known antml: / mm: namespace prefixes for think / thinking / thought while preserving antthinking. #93820 was already open for this root cause, has a stronger PR explanation, and includes separate antml: plus mm: regression coverage.

This PR's source-level proof was valid, but keeping both open creates duplicate landing risk. The right path is to keep the review and CI discussion on #93820.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: imessage Channel integration: imessage size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant