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.
This commit is contained in:
liuhao1024
2026-09-14 18:11:45 -07:00
committed by Teknium
parent 6601a004a3
commit ff307aea5e
+3 -1
View File
@@ -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)