Skip to content

Telegram typing indicator persists indefinitely — run end events never emitted #27226

@evolution1444

Description

@evolution1444

Bug

The Telegram "typing..." indicator gets stuck and persists indefinitely. Runs log embedded run start but never log a corresponding run end, so the typing loop is never cleaned up.

Environment

  • OpenClaw: 2026.2.24 (df9a474)
  • OS: macOS (Apple Silicon), Node v25.5.0
  • Channel: Telegram (direct + group chats affected)

Reproduction

  1. Send any message to the bot on Telegram
  2. Run starts → typing indicator begins (expected)
  3. Run completes, reply is sent successfully
  4. Typing indicator continues indefinitely
  5. openclaw gateway restart clears it temporarily
  6. Returns on next message

Evidence

Run starts logged, zero run ends in entire log file

$ grep "embedded run start" openclaw-2026-02-26.log | wc -l
10

$ grep "run end\|run complete" openclaw-2026-02-26.log | wc -l
0

Every run successfully produces a response (tool calls, messages sent, etc.) but the run completion event is never emitted, so the typing cleanup never fires.

TTL fires but is insufficient

typing TTL reached (2m); stopping typing indicator

The 2-minute TTL does eventually kill individual loops, but by then new messages have triggered new runs with new leaked typing loops.

Sample run start (no matching end)

embedded run start: runId=7e998b87-0c7a-458c-a72f-f577494fd56f 
  sessionId=79e1266b provider=anthropic model=claude-opus-4-6 
  thinking=low messageChannel=telegram

Root Cause

The typing loop is started on run start but the run lifecycle never emits a completion/end event, so:

  • The clearInterval for the 5-second sendChatAction("typing") ping is never called
  • Each new message creates another leaked interval
  • Gateway restart is the only reliable cleanup

Expected Behavior

  • Typing indicator should stop when the run completes (reply sent or NO_REPLY/HEARTBEAT_OK)
  • embedded run end should be logged for every embedded run start

Suggested Fixes

  1. Ensure run end event is always emitted — the run promise resolve/reject should trigger typing cleanup
  2. Tie typing interval to run lifecycle — clear the interval in a finally block
  3. Shorter TTL — 30-60s instead of 2min as a safety net
  4. Log run end events — currently invisible, making debugging difficult

Workaround

openclaw gateway restart clears all stuck typing loops temporarily.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions