Skip to content

fix(imessage): normalize leading echo-cache corruption bytes#73891

Closed
openclaw-clownfish[bot] wants to merge 1 commit into
mainfrom
clownfish/ghcrawl-156611-autonomous-smoke
Closed

fix(imessage): normalize leading echo-cache corruption bytes#73891
openclaw-clownfish[bot] wants to merge 1 commit into
mainfrom
clownfish/ghcrawl-156611-autonomous-smoke

Conversation

@openclaw-clownfish

Copy link
Copy Markdown
Contributor

Summary

Linked refs

Validation

  • pnpm test extensions/imessage/src/monitor/monitor-provider.echo-cache.test.ts
  • pnpm check:changed

Credit

This repairs and carries forward the contributor branch from #62191 with attribution preserved.

ProjectClownfish replacement details:

@openclaw-clownfish openclaw-clownfish Bot added the clawsweeper Tracked by ClawSweeper automation label Apr 29, 2026
@openclaw-barnacle openclaw-barnacle Bot added channel: imessage Channel integration: imessage size: S labels Apr 29, 2026
@greptile-apps

greptile-apps Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR narrows the echo-cache text normalization in the iMessage extension to strip only leading imsg replacement/control-byte corruption characters (U+FFFD and C0/C1 control ranges, excluding TAB and LF), while preserving interior bytes so that multiline or otherwise mixed-content keys remain non-lossy. The change is limited to extensions/imessage/src/monitor/echo-cache.ts with matching test coverage and a CHANGELOG entry.

Confidence Score: 5/5

Safe to merge — narrowly scoped fix with good test coverage and no logic errors found.

The normalization ordering (replace → trim → strip leading corruption → trim) is correct, the for...of iteration correctly handles multi-code-unit characters, and both remember and has go through the same normalizeEchoTextKey path so keys are symmetric. No P0/P1 issues identified.

No files require special attention.

Reviews (1): Last reviewed commit: "fix(imessage): normalize leading echo-ca..." | Re-trigger Greptile

@clawsweeper

clawsweeper Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve.

Keep this PR open. Current main and the latest release still normalize iMessage sent-message echo-cache text with only CRLF normalization plus trim, so leading U+FFFD/C0/C1 corruption still misses the cached outbound key. The PR is a focused implementation candidate carrying forward the closed unmerged #62191 work, with tests that preserve interior control/replacement bytes. It overlaps #63581 and #66169, so maintainers should consolidate or pick the canonical patch rather than close this as implemented.

Best possible solution:

Keep this PR open for maintainer review. The best path is to land this narrow iMessage plugin echo-cache normalization, or combine it with #63581/#66169 into one canonical patch that handles the known leading-prefix variants, preserves interior message bytes, keeps the focused regression tests, and validates with the targeted iMessage monitor tests plus the changed gate.

What I checked:

Likely related people:

  • rmarr: GitHub path history shows b29e180 introduced the central iMessage echo-cache/self-chat dedupe behavior, including post-send cache population, text TTL changes, and targeted tests. (role: introduced echo-cache/self-chat dedupe behavior; confidence: high; commits: b29e180ef407; files: extensions/imessage/src/monitor/echo-cache.ts, extensions/imessage/src/monitor/deliver.ts, extensions/imessage/src/monitor/self-chat-dedupe.test.ts)
  • Ayaan Zaidi [email protected]: Authored and co-authored multiple adjacent iMessage echo/self-chat fixes in current-main history, including trying all inbound echo ids and dropping ambiguous reflected self-chat echoes. (role: adjacent echo/self-chat maintainer; confidence: high; commits: 4a5885df3a36, e3e2a19ab7f1, 1ee4a1606e9a; files: extensions/imessage/src/monitor/inbound-processing.ts, extensions/imessage/src/monitor/self-chat-dedupe.test.ts)
  • neeravmakwana: Authored adjacent merged iMessage fixes for destination_caller_id/self-chat classification and wrapped imsg RPC text fields, and opened earlier closed PR fix(imessage): catch delayed reflected echoes #59980 for delayed/corrupted echo normalization. (role: adjacent merged-feature contributor; confidence: medium; commits: 9267c3f8f2f2, 8ed7c95a6a82, 782b5622b6a5; files: extensions/imessage/src/monitor/inbound-processing.ts, extensions/imessage/src/monitor/types.ts, extensions/imessage/src/monitor/parse-notification.ts)
  • vincentkoc: The source PR discussion says vincentkoc coordinated ProjectClownfish's narrow repair while preserving contributor credit; GitHub history also shows recent iMessage monitor retry/type-seam maintenance in the extension area. (role: recent maintainer and follow-up coordinator; confidence: medium; commits: 35a784c16563, ea71a59127a0, 503b43f43f61; files: extensions/imessage/src/monitor/monitor-provider.ts, extensions/imessage/src/monitor/watch-error-log.ts, extensions/imessage/src)

Remaining risk / open question:

  • The PR overlaps active open PRs imessage: strip NUL bytes from echo-cache text normalization #63581 and [codex] fix(imessage): normalize attributed echo prefixes #66169; maintainers should consolidate or choose one canonical iMessage echo-cache prefix normalizer before landing competing branches.
  • The normalization intentionally treats leading U+FFFD/C0/C1 bytes as echo-cache corruption within the existing 4s text fallback window, so there is a small functional false-positive risk if a real user sends the same text with such a leading prefix immediately after an outbound message.
  • No supply-chain, workflow, dependency, lockfile, publishing, permission, or secret-handling risk was found in the PR diff.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 293348b429b4.

@vincentkoc

Copy link
Copy Markdown
Member

Thanks for pushing this. We merged the narrower canonical fix in #73942: #73942, merge be445dd. It keeps normalization limited to observed leading attributedBody markers and leaves TTL and broader control-byte behavior separate. Testbox proof: tbx_01kqbp2m7s1mn1nd4fhgnp74wk focused iMessage tests plus check:changed passed. Closing this overlap.

@vincentkoc vincentkoc closed this Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: imessage Channel integration: imessage clawsweeper Tracked by ClawSweeper automation size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant