From 0a984e228a419a77d50f421bdb14371c7cb74a3a Mon Sep 17 00:00:00 2001 From: banteg <4562643+banteg@users.noreply.github.com> Date: Sun, 28 Dec 2025 20:30:56 +0400 Subject: [PATCH] feat(exec-bridge): send typing indicator on start --- codex/codex_telegram_bridge/bridge_common.py | 7 +++++++ codex/codex_telegram_bridge/exec_bridge.py | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/codex/codex_telegram_bridge/bridge_common.py b/codex/codex_telegram_bridge/bridge_common.py index 0fdb287..2e0256f 100644 --- a/codex/codex_telegram_bridge/bridge_common.py +++ b/codex/codex_telegram_bridge/bridge_common.py @@ -139,6 +139,13 @@ class TelegramClient: sent.append(msg) return sent + def send_chat_action(self, chat_id: int, action: str = "typing") -> Dict[str, Any]: + params: Dict[str, Any] = { + "chat_id": chat_id, + "action": action, + } + return self._call("sendChatAction", params) + @dataclass(frozen=True) class Route: diff --git a/codex/codex_telegram_bridge/exec_bridge.py b/codex/codex_telegram_bridge/exec_bridge.py index 2bfd359..818305d 100644 --- a/codex/codex_telegram_bridge/exec_bridge.py +++ b/codex/codex_telegram_bridge/exec_bridge.py @@ -193,6 +193,11 @@ def main() -> None: f"chat_id={chat_id} user_msg_id={user_msg_id} resume_session={resume_session!r}" ) try: + try: + bot.send_chat_action(chat_id=chat_id, action="typing") + log(f"[handle] sent typing indicator chat_id={chat_id}") + except Exception as e: + log(f"[handle] failed typing indicator chat_id={chat_id}: {e}") session_id, answer = runner.run_serialized(text, resume_session) sent_msgs = bot.send_message_chunked( chat_id=chat_id,