From a8c65b50cad03466ab4c2b69ffb9be47546c6b4b Mon Sep 17 00:00:00 2001 From: NanoBot Date: Sat, 20 Jun 2026 19:44:20 +0800 Subject: [PATCH] fix: narrow rich capability error detection to prevent false latch - Remove overly broad 'not found' match that could trigger on transient errors like 'chat not found' or 'message to reply not found' - Keep only 'method not found' and 'unknown method' which indicate the server genuinely doesn't support sendRichMessage - Demote timeout log from warning to debug since it falls back to legacy path successfully --- nanobot/channels/telegram.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/nanobot/channels/telegram.py b/nanobot/channels/telegram.py index 18d13410..85a0facc 100644 --- a/nanobot/channels/telegram.py +++ b/nanobot/channels/telegram.py @@ -639,9 +639,8 @@ class TelegramChannel(BaseChannel): err = str(exc).lower() return ( "method not found" in err - or "not found" in err - or "bad request: invalid parameter" in err or "unknown method" in err + or "bad request: invalid parameter" in err ) async def _try_send_rich( @@ -694,7 +693,7 @@ class TelegramChannel(BaseChannel): err_str = str(exc).lower() is_timeout = "timed out" in err_str or isinstance(exc, TimedOut) if is_timeout: - self.logger.warning("sendRichMessage timeout, not retrying legacy") + self.logger.debug("sendRichMessage timeout, falling back to legacy path") return False self.logger.debug("sendRichMessage failed: {}", exc) return False