From 601e5f1d57cfd4ceefee50a6df05a860a1a602e8 Mon Sep 17 00:00:00 2001
From: teknium1 <127238744+teknium1@users.noreply.github.com>
Date: Mon, 4 May 2026 20:53:57 -0700
Subject: [PATCH] fix(teams): log reply() fallback for diagnostics
The previous bare except swallowed every exception from app.reply()
silently. Log at debug so real failures (auth, chat gone) leave a
trace while keeping the group-chat 400 fallback working. Also fix
the Teams entry's indentation in the messaging flowchart.
---
plugins/platforms/teams/adapter.py | 9 ++++++++-
website/docs/user-guide/messaging/index.md | 6 +++---
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/plugins/platforms/teams/adapter.py b/plugins/platforms/teams/adapter.py
index 2729de8f41..cdec7e3f1e 100644
--- a/plugins/platforms/teams/adapter.py
+++ b/plugins/platforms/teams/adapter.py
@@ -512,7 +512,14 @@ class TeamsAdapter(BasePlatformAdapter):
if reply_to and reply_to.isdigit() and reply_to != "0":
try:
result = await self._app.reply(chat_id, reply_to, chunk)
- except Exception:
+ except Exception as reply_err:
+ # Group chats 400 on threaded sends; the Teams SDK
+ # doesn't expose typed HTTP errors, so fall back on
+ # any exception and log for diagnostics.
+ logger.debug(
+ "Teams reply() failed, falling back to flat send: %s",
+ reply_err,
+ )
result = await self._app.send(chat_id, chunk)
else:
result = await self._app.send(chat_id, chunk)
diff --git a/website/docs/user-guide/messaging/index.md b/website/docs/user-guide/messaging/index.md
index c68bdae91c..25e8e4598f 100644
--- a/website/docs/user-guide/messaging/index.md
+++ b/website/docs/user-guide/messaging/index.md
@@ -60,9 +60,9 @@ flowchart TB
bb[BlueBubbles]
qq[QQ]
yb[Yuanbao]
- ms[Microsoft Teams]
- api["API Server
(OpenAI-compatible)"]
- wh[Webhooks]
+ ms[Microsoft Teams]
+ api["API Server
(OpenAI-compatible)"]
+ wh[Webhooks]
end
store["Session store
per chat"]