From ff307aea5e84ea5bc30bdb09ff73125969ec0cd9 Mon Sep 17 00:00:00 2001 From: liuhao1024 Date: Mon, 14 Sep 2026 18:11:45 -0700 Subject: [PATCH] fix(telegram): name empty-string transport errors in adapter log lines httpx timeout exceptions (ConnectTimeout, ReadTimeout, ...) stringify to "" so every adapter log line built from _redact_telegram_error_text() ended with a blank reason. Fall back to the exception class name. Partial salvage of #111222: only the _redact_telegram_error_text hunk; the transport-layer and polling-recovery hunks are covered by #111221. --- plugins/platforms/telegram/adapter.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/platforms/telegram/adapter.py b/plugins/platforms/telegram/adapter.py index 73ef76acf5..071999cef7 100644 --- a/plugins/platforms/telegram/adapter.py +++ b/plugins/platforms/telegram/adapter.py @@ -29,7 +29,9 @@ def _redact_telegram_error_text(error: object) -> str: """Redact secrets from Telegram transport errors before logging or returning them.""" text = "" if error is None else str(error) if not text: - return text + # httpx timeout exceptions (ConnectTimeout, ReadTimeout, ...) stringify to "" — keep the + # class name so failure lines never log an empty reason (#111211). + return f"<{type(error).__name__}>" if error is not None else text try: from agent.redact import redact_sensitive_text return redact_sensitive_text(text, force=True)