fix(imessage): use phone number for DM replies instead of chat_id#372
Closed
mshuffett wants to merge 1 commit intoopenclaw:mainfrom
Closed
fix(imessage): use phone number for DM replies instead of chat_id#372mshuffett wants to merge 1 commit intoopenclaw:mainfrom
mshuffett wants to merge 1 commit intoopenclaw:mainfrom
Conversation
The imsg CLI's AppleScript doesn't handle chat_id correctly for 1:1 DM chats - it converts the numeric chat_id to the identifier and uses wrong syntax. This causes "Internal error" when trying to send replies. For DMs, use the sender's phone number directly which works reliably. Groups still use chat_id as it's needed for targeting group chats. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Contributor
|
Thanks Michael, iMessage was still a bit unfinished, good to have you helping here! Luckily they go together so I'll see where to best land the fix. |
Contributor
|
Fixed upstream in imsg (v0.3.2): steipete/imsg@aafe3f3 |
Contributor
|
Closing; fixed upstream in imsg 0.3.2. |
Contributor
|
Updated upstream fix (amended): steipete/imsg@99d03c8 |
Author
|
Ok great yeah that is the better fix I just didn't want to mess with imsg at the time tbh. @steipete |
dgarson
added a commit
to dgarson/clawdbot
that referenced
this pull request
Feb 9, 2026
* Slack: add reaction escalation support * Slack: handle thread reactions for escalation * fix: minor bug fix from PR review * bug fix * fix: resolve linting errors across codebase - Fixed 696 linting errors down to 0 errors (257 warnings remain) - Changed no-explicit-any from error to warn (222 instances) - Fixed no-unused-vars errors by removing unused imports/variables - Fixed no-base-to-string errors with proper type checking - Fixed restrict-template-expressions by using String() - Fixed require-array-sort-compare with compare functions - Fixed await-thenable by removing unnecessary await - Fixed no-unnecessary-template-expression - Added eslint-disable for intentional control character regex - Changed no-unused-vars to warn for test files Co-Authored-By: Claude Sonnet 4.5 <[email protected]> --------- Co-authored-by: Claude Sonnet 4.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix iMessage DM replies failing with "Internal error" when using
chat_idparameter.Problem
When replying to iMessage DMs, clawdbot uses
chat_id(e.g.,chat_id:18) as the reply target. TheimsgCLI then fails with:The
imsgCLI appears to be looking up the chat by numeric ID, then incorrectly passing the chat's identifier (phone number) to AppleScript aschat id "+1XXXXXXXXXX"instead of using the numeric ID or a different AppleScript syntax.Solution
For DMs, use the sender's phone number directly (e.g.,
to: "+1XXXXXXXXXX") which works reliably with AppleScript. Groups continue to usechat_idas it's necessary for targeting group chats.Test results
imsg send --to "+1XXXXXXXXXX" --text "test"→ ✅ worksimsg rpcwith{"to":"+1XXXXXXXXXX",...}→ ✅ worksimsg rpcwith{"chat_id":18,...}→ ❌ fails with AppleScript error aboveNote
This may be a bug in the
imsgCLI itself (incorrect AppleScript generation forchat_idon 1:1 chats), but this workaround resolves the issue for clawdbot users.