#5810: feat(imessage): add myNumbers config to filter by destination phone number
channel: imessage
Cluster:
Messaging Platform Improvements
Adds a `myNumbers` config option to the iMessage channel that filters inbound messages by destination caller ID. This allows agents with multiple phone numbers to only respond to messages sent to specific numbers.
## Changes
- Added `myNumbers: string[]` to iMessage channel config schema
- Filters inbound messages where `destination_caller_id` matches configured numbers
- Logs skipped messages for debugging
## Dependency
Requires [steipete/imsg#29](https://github.com/steipete/imsg/pull/29) to expose the `destination_caller_id` field.
---
*AI-assisted PR*
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR adds a new `myNumbers: string[]` configuration option to the iMessage channel, extends the config schema to accept it, and updates the iMessage monitor to drop inbound messages whose `destination_caller_id` does not match the configured numbers. It also logs when messages are skipped to aid debugging. The change fits cleanly into the existing iMessage inbound processing path (`monitorIMessageProvider`) by applying the filter early, before allowlist/pairing/group handling.
<h3>Confidence Score: 4/5</h3>
- This PR is likely safe to merge; changes are localized and low-risk.
- The implementation is a straightforward early-return filter gated behind an optional config field, with no changes to core routing logic beyond skipping some inbound messages. Main risk is around config ergonomics/validation and runtime override expectations rather than correctness or security.
- src/imessage/monitor/monitor-provider.ts
<!-- greptile_other_comments_section -->
<sub>(5/5) You can turn off certain types of comments like style [here](https://app.greptile.com/review/github)!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#3300: changed chat session selection logic in iMessage
by KimEJ · 2026-01-28
70.2%
#18664: fix(imessage): honor groupConfig regardless of allowlistEnabled
by brandonwise · 2026-02-16
70.0%
#2799: fix(imessage): prevent self-chat and outbound echo loops (#2585)
by Tfh-Yqf · 2026-01-27
68.7%
#22168: fix(imessage): resolve group sessions without chat identifiers
by AIflow-Labs · 2026-02-20
67.4%
#16783: Fix cross-channel routing in iMessage monitor
by fengwen2013 · 2026-02-15
66.6%
#15853: feat: add option to suppress media placeholder text
by MisterGuy420 · 2026-02-14
66.0%
#7118: feat(imessage): add markdown.strip config option
by PeterRosdahl · 2026-02-02
65.5%
#10470: Fix: iMessage real-time delivery via imsg watch
by saurav470 · 2026-02-06
65.0%
#7353: fix: prevent silent message drops after config.patch restart
by 18-RAJAT · 2026-02-02
64.9%
#17380: fix(imessage): reject non-numeric chat_id values to prevent silent ...
by aldoeliacim · 2026-02-15
63.9%