Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@aaronn
Copy link
Contributor

@aaronn aaronn commented Jan 25, 2026

Closes #1604, which was accidentally skipping normalization for messages sent to iMessage. This caused messages to occasionally be prefixed with something like [imessage:#+1234567]

Context

There are two types of messages that can be sent: replies, and messages. Replies go to the sender's channel, but messages are independently fired by Clawd. This means they don't necessarily know which channel to reply to and therefore occasionally attach headers, like [imessage:#+1234567] to pass as metadata.

When sending messages, iMessage wasn't properly normalizing the output. There are a number of patterns the other channels follow (for example normalizeDiscordMessagingTarget) that were not being applied. This PR:

  1. Adds those for iMessage to be used.
  2. Cleans up some of the import grouping for iMessage.

@aaronn aaronn changed the title fix imessage bug Fix iMessage normalization being skipped. Jan 25, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7d6db454cf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@aaronn
Copy link
Contributor Author

aaronn commented Jan 25, 2026

@codex review again

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 78367b47f8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +21 to +22
const normalized = normalizeIMessageHandle(trimmed);
return normalized || undefined;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3 Badge Normalize chat_id prefixes case-insensitively

normalizeIMessageMessagingTarget returns normalizeIMessageHandle(trimmed) for non-service prefixes, but normalizeIMessageHandle does not lowercase chat_id:/chat_guid: prefixes. That means inputs like CHAT_ID:123 now normalize to CHAT_ID:123 instead of chat_id:123, whereas previously iMessage targets were lowercased by the default normalizer. Because normalizeTargetForProvider drives cross‑context checks and duplicate suppression, mixed‑case chat_id inputs can now be treated as a different target and trigger false cross‑context errors or duplicate replies. Consider lowercasing chat_* prefixes (or all non-handle targets) before returning.

Useful? React with 👍 / 👎.

@aaronn
Copy link
Contributor Author

aaronn commented Jan 25, 2026

@codex ready for review again

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@steipete steipete self-assigned this Jan 25, 2026
steipete added a commit that referenced this pull request Jan 25, 2026
@steipete
Copy link
Contributor

Landed via squash on main: 71eb6d5.

Changes: merged PR + added changelog entry + updated clawtributors.

Tests: pnpm lint, pnpm build, pnpm test (first run hit pnpm "Unexpected end of JSON input"; reran pnpm test clean).

steipete added a commit to orlyjamie/clawdbot that referenced this pull request Jan 25, 2026
@steipete steipete closed this Jan 25, 2026
mcinteerj pushed a commit to mcinteerj/moltbot that referenced this pull request Jan 25, 2026
rodrigouroz pushed a commit to rodrigouroz/moltbot that referenced this pull request Jan 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Phone number appearing in messages from Clawd

2 participants