From 420762f867460bc603d7aab0f6e9684f63fad5a2 Mon Sep 17 00:00:00 2001 From: AhmetArif0 <147827411+AhmetArif0@users.noreply.github.com> Date: Tue, 12 May 2026 18:48:38 -0700 Subject: [PATCH] fix(tools): forward thread_id via metadata in _send_via_adapter live path The live adapter path in _send_via_adapter called adapter.send() without passing thread_id, while the standalone fallback path correctly forwarded it. For plugin platforms (google_chat, teams, irc, line) running with the gateway in-process, this caused every threaded reply to land as a new top-level message instead of continuing the thread. Matches the pattern already used by _send_matrix_via_adapter and _send_feishu: build metadata={"thread_id": thread_id} and pass it through. --- tools/send_message_tool.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/send_message_tool.py b/tools/send_message_tool.py index 664c8736a12..d5b2c0c782c 100644 --- a/tools/send_message_tool.py +++ b/tools/send_message_tool.py @@ -461,7 +461,8 @@ async def _send_via_adapter( adapter = None if adapter is not None: try: - result = await adapter.send(chat_id=chat_id, content=chunk) + metadata = {"thread_id": thread_id} if thread_id else None + result = await adapter.send(chat_id=chat_id, content=chunk, metadata=metadata) except asyncio.CancelledError: raise except Exception as e: