Skip to content

feat(telegram): live progress indicator for the remote-control channel#28

Open
SergiioB wants to merge 1 commit into
AtomicBot-ai:mainfrom
SergiioB:feat/telegram-live-progress-indicator
Open

feat(telegram): live progress indicator for the remote-control channel#28
SergiioB wants to merge 1 commit into
AtomicBot-ai:mainfrom
SergiioB:feat/telegram-live-progress-indicator

Conversation

@SergiioB

Copy link
Copy Markdown

What

The Telegram remote-control channel now posts an editable "Thinking…" bubble the moment an owner message lands, updates it live with the turn's activity, and removes it when the reply is ready.

Why

Today the only feedback is the native chatAction: "typing" dots. They are easy to miss and disappear the instant a fast reply lands, so a short answer gives no visible sign the message was received. This adds a clear, persistent acknowledgement that also surfaces what the agent is doing on longer turns.

Behavior

  • On message receipt: posts 🤔 Thinking….
  • During the turn: edits the bubble with live activity — ⚙️ Working… (step N), 🔧 <tool> (from tool_call_parsed), ✅ <step summary> (from step_finished), 🔁 Repeating <tool> (×N) (from loop_detected).
  • On settle: deletes the bubble and posts the reply (or the existing cancel/failure infra message) so the answer stands alone.
  • The existing typing-dot keepalive is unchanged and still runs.

Implementation notes

  • New TelegramProgressIndicator in inbound-handler.ts, wired into dispatchToRuntime through the existing eventHook.
  • Adds an optional deleteMessage to the TelegramApi surface (grammy's bot.api already provides it).
  • Pure channel infrastructure: every post/edit/delete is best-effort and serialised through one promise chain. Edits are throttled (~700 ms) with identical-text suppression to stay well under Telegram's per-chat edit rate limits. A fast turn that calls remove() before the initial sendMessage resolves still cleans up the just-posted message.
  • No config change; the indicator is always on, matching the always-on typing keepalive. Happy to gate it behind a telegram.* flag if you prefer.

Testing

  • All 129 existing Telegram channel tests pass (vitest run src/channels/telegram/), including the 23 inbound-handler tests.
  • Running in production on a headless Linux (ARM64) serve deployment against a remote llama-server.

Happy to add a dedicated unit test for the indicator lifecycle and/or put it behind a config flag if that helps merge.

Post an editable "Thinking…" bubble the moment an owner message lands and
update it live with the turn's activity (step count, tool name, step
summary) until the reply is ready, then remove it so the answer stands
alone.

The existing chatAction "typing" dots are kept but are too subtle to read
as an acknowledgement and vanish the instant a fast reply lands, leaving
the operator with no visible feedback that their message was received.

The indicator is pure channel infrastructure: every post/edit/delete is
best-effort and serialised through an internal promise chain, throttled to
~1.4 edits/s with identical-text suppression, and a fast turn that removes
the bubble before the initial send resolves still cleans up correctly.
Adds an optional deleteMessage to the TelegramApi surface.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant