The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(telegram): catch NetworkError, not TelegramError, after a kept-prompt edit fails
Tekniumce0602e8a97b
diff --git a/plugins/platforms/telegram/telegram_resolved_prompt.py b/plugins/platforms/telegram/telegram_resolved_prompt.pyindex f8098ea9590..fa73ecd4206 100644--- a/plugins/platforms/telegram/telegram_resolved_prompt.py+++ b/plugins/platforms/telegram/telegram_resolved_prompt.py@@ -18,7 +18,7 @@ logger = logging.getLogger(__name__)async def edit_keeping_prompt(adapter: Any, query: Any, decision: str) -> None:"""Append *decision* to the prompt and drop its buttons; the adapter's decision-only edit runs whenthe prompt has no readable body or the appended line pushes it past Telegram's length cap."""- from telegram.error import BadRequest, TelegramError+ from telegram.error import BadRequest, NetworkErrorbody = getattr(query.message, "text_html", None) if query.message else Noneif isinstance(body, str) and body:@@ -28,7 +28,7 @@ async def edit_keeping_prompt(adapter: Any, query: Any, decision: str) -> None:returnexcept BadRequest: # too long / unparsable: the decision-only edit below still clears the buttonspass- except TelegramError as exc: # network/timeout: the edit may have landed, so keep the prompt as is+ except NetworkError as exc: # network/timeout: the edit may have landed, so keep the prompt as islogger.debug("Telegram resolved-prompt edit failed: %s", exc)returnawait adapter._edit_md_quiet(query, decision)