fix(send_message): accept Matrix room IDs and user MXIDs as explicit targets

`_parse_target_ref` has explicit-reference branches for Telegram, Feishu,
and numeric IDs, but none for Matrix. As a result, callers of
`send_message(target="matrix:!roomid:server")` or
`send_message(target="matrix:@user:server")` fall through to
`(None, None, False)` and the tool errors out with a resolution failure —
even though a raw Matrix room ID or MXID is the most unambiguous possible
target.

Three-line fix: recognize `!…` as a room ID and `@…` as a user MXID when
platform is `matrix`, and return them as explicit targets. Alias-based
targets (`#…`) continue to go through the normal resolve path.
This commit is contained in:
bkadish 2026-04-08 05:15:15 -07:00 committed by Teknium
parent df7be3d8ae
commit 03446e06bb

View file

@ -248,6 +248,9 @@ def _parse_target_ref(platform_name: str, target_ref: str):
return match.group(1), None, True
if target_ref.lstrip("-").isdigit():
return target_ref, None, True
# Matrix room IDs (start with !) and user IDs (start with @) are explicit
if platform_name == "matrix" and (target_ref.startswith("!") or target_ref.startswith("@")):
return target_ref, None, True
return None, None, False