fix(photon): support E.164 and DM GUID targets for home channel
Allow PHOTON_HOME_CHANNEL to accept a bare E.164 phone number or a `any;-;+1...` DM chat GUID in addition to a Spectrum space id. Inbound DM spaces are cached so replies resolve without a second SDK lookup, and `photon` is added to _PHONE_PLATFORMS so send_message treats E.164 strings as explicit targets rather than falling through to channel-name resolution.
This commit is contained in:
parent
92179352fb
commit
0646656884
5 changed files with 86 additions and 11 deletions
20
tests/tools/test_send_message_target_parse.py
Normal file
20
tests/tools/test_send_message_target_parse.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
"""Parser-only tests for send_message targets.
|
||||
|
||||
These stay separate from ``test_send_message_tool.py`` because that module
|
||||
skips wholesale when optional Telegram dependencies are not installed.
|
||||
"""
|
||||
|
||||
from tools.send_message_tool import _parse_target_ref
|
||||
|
||||
|
||||
def test_photon_e164_target_is_explicit() -> None:
|
||||
chat_id, thread_id, is_explicit = _parse_target_ref("photon", "+15551234567")
|
||||
|
||||
assert chat_id == "+15551234567"
|
||||
assert thread_id is None
|
||||
assert is_explicit is True
|
||||
|
||||
|
||||
def test_e164_target_still_requires_phone_platform() -> None:
|
||||
assert _parse_target_ref("matrix", "+15551234567")[2] is False
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue