Repository navigation
cmux-imessage: send to a chat through Messages.app (opt-in mirror, library step) - #32919
Conversation
Adds the send module's API with stub bodies and the tests it must pass: the text reaches osascript only as argv (a hostile string stays data), validation of empty, long and malformed chat ids, one osascript call per send, and the Automation-denied / no-such-chat / missing-osascript / timeout error codes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-f62148d989879feda740
Runs osascript with a fixed script (`send messageText to chat id chatGuid`), passing the chat guid and the text as argv only. Validates the request, maps AppleScript -1743 to not_permitted (Automation not allowed) and -1728 to invalid_chat, and stops a send that runs past two minutes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-f62148d989879feda740
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
red: cmux-next checks (god files, concurrency, crash safety, l10n); no finished base run on 1a31709 to compare; do not merge until green; see lane-rules Shipped in:
|
|
Review (codex, router-review): SHIP at fd985be Reviewer: codex gpt-6-astra high, fast tier. Follow-ups: 2. Each lands as an issue in this repo that links this receipt; the lane that opened the PR fixes it forward. SHIP at fd985be
Tests could not run because Rust tooling is unavailable. Follow-ups:
|
Leo's ask: "i mean like obviously we already are in an imessage type zone im saying like actual imessage chats with contacts/group chats" ... "hm. could we mirror it?"
This is the sending half of the opt-in Messages mirror, at the library level. It adds
cmux_imessage::sendto the crate from #32891. Nothing calls it yet: the daemon op and the composer come in a follow-up, behind the same off-by-defaultimessage.enabledsetting, and every send needs a user gesture.What it does
send(&SendRequest { chat_guid, text }, &SystemRunner)runsosascriptwith a fixed script:tell application "Messages" to send messageText to chat id chatGuid.argvitems and are never spliced into its source, so a message can't change what the script does. A test sends a hostile string and checks that it arrives verbatim.service;-;idorservice;+;id, with no control characters and no leading-, so osascript never reads it as an option.-1743(Automation of Messages not allowed) becomesnot_permitted.-1728(no such chat) becomesinvalid_chat.unsupported.timed_out.failed.Nothing leaves the Mac except the message Leo sends through his own Messages.app.
Tests
Two commits: the failing tests against stubs (5 of 5 red), then the implementation (5 of 5 green, the reader's 10 still green, clippy
-D warningsclean on Linux CI). They use a fake runner, so no Messages.app or osascript is needed.Agent session: agent session
🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Adds
cmux_imessage::send, the sending half of the opt-in Messages mirror at the library level. Nothing calls it yet; the daemon op and composer follow in a later PR, behind the same off-by-defaultimessage.enabledsetting, and every send needs a user gesture.Security and validation
argvitems, never spliced into its source, so a hostile message can't change what the script does.service;-;idorservice;+;idwith no control characters and no leading-.-1743(Automation not allowed) maps tonot_permitted,-1728(no such chat) toinvalid_chat, missing osascript tounsupported, a two-minute overrun totimed_out, and anything else tofailed.Tests
Written for commit fd985be. Summary will update on new commits.