From 03446e06bbfe60bff074d1bbb5336bdd6849ddc3 Mon Sep 17 00:00:00 2001 From: bkadish <146666892+bkadish@users.noreply.github.com> Date: Wed, 8 Apr 2026 05:15:15 -0700 Subject: [PATCH] fix(send_message): accept Matrix room IDs and user MXIDs as explicit targets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `_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. --- tools/send_message_tool.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/send_message_tool.py b/tools/send_message_tool.py index 391e03baa..f99bcdaf4 100644 --- a/tools/send_message_tool.py +++ b/tools/send_message_tool.py @@ -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