iMessage plugin: reply fails on macOS with 'any;-;' chat GUID format

Status Closed — not planned
Maintainer reply None cached
Activity 2 comments · opened Apr 11, 2026 · closed May 22, 2026

Summary

The iMessage plugin's reply tool fails to send messages on newer macOS versions where chat.db stores DM chat GUIDs with the any;-; prefix instead of the traditional iMessage;-; or SMS;-; prefixes.

Environment

  • macOS Tahoe (Darwin 25.4.0)
  • iMessage plugin v0.1.0

Steps to Reproduce

  1. Receive a DM via the iMessage plugin channel
  2. The inbound message arrives with chat_id="any;-;+81XXXXXXXXXX"
  3. Attempt to reply using the reply tool with this chat_id

Observed Behavior

  • Using any;-;+81XXXXXXXXXX (as provided in the inbound message): passes the allowlist check, but Messages.app AppleScript rejects the GUID with error -1728 ("chat id を取り出すことはできません")
  • Using iMessage;-;+81XXXXXXXXXX: fails the allowlist check because this GUID doesn't exist in chat.db
  • Using SMS;-;+81XXXXXXXXXX: same allowlist failure

Root Cause

In server.ts, the sendText() function passes the chat GUID directly to AppleScript:

tell application "Messages" to send (item 1 of argv) to chat id (item 2 of argv)

The allowedChatGuids() function correctly queries chat.db and returns any;-; GUIDs, so the allowlist check passes. However, Messages.app's AppleScript API does not recognize the any;-; prefix.

Workaround

Sending via participant instead of chat id works:

tell application "Messages"
  set theService to 1st account whose service type = iMessage
  set theBuddy to participant "+81XXXXXXXXXX" of theService
  send "message" to theBuddy
end tell

Suggested Fix

Either:

  1. Normalize any;-; GUIDs to the appropriate service prefix (iMessage;-; or SMS;-;) before passing to AppleScript, or
  2. Fall back to sending via participant of a service when chat id based sending fails

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗