openclaw - 💡(How to fix) Fix Telegram channel: keep sendChatAction("typing") alive while a turn is in flight [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#71813Fetched 2026-04-26 05:07:55
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Timeline (top)
commented ×1mentioned ×1subscribed ×1

Error Message

  • agent error / timeout
  • Network failures on sendChatAction (already seen in Joey's logs as telegram sendChatAction failed: Network request for 'sendChatAction' failed!) shouldn't kill the interval — they should swallow the error and try again on next tick

Root Cause

  • It's the single best signal Telegram gives users that "your message is being processed."
  • Without it, every long turn looks like a hang. Users either re-ping (which can confuse the agent's turn machinery) or assume the agent died and restart manually.
  • Goose runs browser automation / Maverick runs cron orchestration — both routinely have multi-minute turns. The single 5s typing flash is misleading.

Code Example

file: dist/subsystem-bmJ5rL4Q.js (and corresponding source)
subsystem: gateway/channels/telegram
existing: telegram sendChatAction failed: Network request for 'sendChatAction' failed!
RAW_BUFFERClick to expand / collapse

[feature] Telegram channel: keep sendChatAction("typing") alive while a turn is in flight

Problem

Today the Telegram channel plugin sends sendChatAction("typing") once on inbound message receipt. Telegram only honors that for ~5 seconds, after which the "… typing" indicator disappears in the user's chat.

For long-running agent turns (browser automation, multi-step tool sequences, anything that takes >5s), the user has no idea whether the agent is still processing or has gone silent / wedged. From the user's perspective, a healthy 30s turn looks identical to a wedged session — both show "no typing indicator, no message yet."

Current behavior

  • User sends "do X"
  • Channel emits one sendChatAction("typing") → indicator shows for ~5s
  • Indicator disappears
  • Agent works for another 25s
  • Final assistant message arrives

During the silent 25s, the user often re-pings the agent ("are you there?"), assumes it's stuck, or escalates manually (SSH in, restart gateway, etc.).

Proposed behavior

While a turn is in flight (between inbound user message and final assistant reply being delivered), the Telegram channel plugin refreshes sendChatAction("typing") every 4 seconds so the indicator stays continuously visible. Stops on:

  • final reply sent
  • agent error / timeout
  • channel disconnection

Same behavior would help on record_voice / upload_document actions when the agent is generating media, but plain typing covers the 95% case.

Why this matters

  • It's the single best signal Telegram gives users that "your message is being processed."
  • Without it, every long turn looks like a hang. Users either re-ping (which can confuse the agent's turn machinery) or assume the agent died and restart manually.
  • Goose runs browser automation / Maverick runs cron orchestration — both routinely have multi-minute turns. The single 5s typing flash is misleading.

Implementation sketch (open to whatever fits the codebase)

Roughly: when the channel hands an inbound message off to the agent runtime, kick off a setInterval(() => sendChatAction(chatId, "typing"), 4000). Clear the interval when the response is delivered or the turn errors out.

Edge cases worth handling:

  • Multiple concurrent turns in different chats → one interval per chat_id
  • Network failures on sendChatAction (already seen in Joey's logs as telegram sendChatAction failed: Network request for 'sendChatAction' failed!) shouldn't kill the interval — they should swallow the error and try again on next tick
  • Don't fire on cron / silent / --announce-only payloads where there's no upstream user waiting

Reference: existing call site

file: dist/subsystem-bmJ5rL4Q.js (and corresponding source)
subsystem: gateway/channels/telegram
existing: telegram sendChatAction failed: Network request for 'sendChatAction' failed!

So the call already exists — the change is wrapping it in a per-turn interval rather than firing once.

Discord channel

Similar gap probably exists on Discord (channelTyping / MessageTyping indicator also expires after ~10s). Worth applying the same pattern there once the Telegram side is settled.


Filed by user @joeywrightphoto on behalf of his triple-agent setup (Maverick / Goose / Merlin) — running into this multiple times per day on long browser-automation turns.

extent analysis

TL;DR

Implement a setInterval to refresh sendChatAction("typing") every 4 seconds while a turn is in flight to keep the "… typing" indicator visible.

Guidance

  • Identify the point where the channel hands an inbound message off to the agent runtime and kick off the interval from there.
  • Use a unique interval per chat_id to handle multiple concurrent turns in different chats.
  • Implement error handling for network failures on sendChatAction to prevent the interval from being killed.
  • Consider adding a check to exclude cron, silent, or --announce-only payloads from firing the typing indicator.

Example

const typingInterval = setInterval(() => {
  sendChatAction(chatId, "typing");
}, 4000);

This interval should be cleared when the response is delivered or the turn errors out.

Notes

The proposed solution assumes that the sendChatAction function is already implemented and working correctly. Additionally, the interval duration of 4 seconds is chosen to keep the indicator visible while avoiding excessive network requests.

Recommendation

Apply the workaround by implementing the setInterval to refresh sendChatAction("typing") while a turn is in flight, as this will provide a clear signal to users that their message is being processed.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Telegram channel: keep sendChatAction("typing") alive while a turn is in flight [1 comments, 2 participants]