-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Fix iMessage normalization being skipped. #1708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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".
|
@codex review again |
There was a problem hiding this 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".
| const normalized = normalizeIMessageHandle(trimmed); | ||
| return normalized || undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 👍 / 👎.
…ase-insensitively
|
@codex ready for review again |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Co-authored-by: Aaron Ng <[email protected]>
|
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). |
Co-authored-by: Aaron Ng <[email protected]>
Co-authored-by: Aaron Ng <[email protected]>
Co-authored-by: Aaron Ng <[email protected]>
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: