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.
This commit is contained in:
AhmetArif0 2026-05-12 18:48:38 -07:00 committed by Teknium
parent e77fd75c44
commit 420762f867

View file

@ -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: