From 3f023450ddab8af48814fd715d3f0ee4318026ee Mon Sep 17 00:00:00 2001 From: Aamir Jawaid Date: Fri, 1 May 2026 05:21:28 +0000 Subject: [PATCH] fix(teams): fall back to flat send when threading returns 400 Group chats return 400 for threaded sends. Catch the error and fall back to a flat send so messages always get delivered. Co-Authored-By: Claude Sonnet 4.6 --- plugins/platforms/teams/adapter.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/platforms/teams/adapter.py b/plugins/platforms/teams/adapter.py index 9bc4ac3499..2729de8f41 100644 --- a/plugins/platforms/teams/adapter.py +++ b/plugins/platforms/teams/adapter.py @@ -509,8 +509,11 @@ class TeamsAdapter(BasePlatformAdapter): for chunk in chunks: try: - if reply_to: - result = await self._app.reply(chat_id, reply_to, chunk) + if reply_to and reply_to.isdigit() and reply_to != "0": + try: + result = await self._app.reply(chat_id, reply_to, chunk) + except Exception: + result = await self._app.send(chat_id, chunk) else: result = await self._app.send(chat_id, chunk) last_message_id = getattr(result, "id", None)