Skip to content

[Bug]: Telegram topic + busy queue + heartbeat/system events can replay turns and break voice-note handling #58418

@jay111112312331

Description

@jay111112312331

Summary

In a real Telegram group forum topic session on OpenClaw 2026.3.28, we are seeing a compound failure mode where:

  • interactive user messages arrive while the agent/session is busy
  • followup queue / drain behavior appears to replay or re-process content
  • heartbeat / system-event traffic shares the same runtime surface and can interfere with the session lane
  • voice notes in this context are especially fragile (transcription often missing unless manually handled outside the queued media path)

This looks like an overlap of several known issue families, but the combined Telegram topic + busy followup + heartbeat/system-event case deserves its own consolidated bug because in practice it presents as repeated/stale/weird behavior that is hard to reason about.

Environment

  • OpenClaw version: 2026.3.28
  • Platform: macOS 15.6 arm64
  • Channel: Telegram
  • Chat type: group forum topic
  • Session key shape: agent:main:telegram:group:<chatId>:topic:<topicId>
  • Heartbeat: enabled on main agent every 30m
  • Gateway: local loopback

Observed symptoms

Over repeated usage in Telegram forum topics:

  • queued / followup behavior seems to replay or re-process prior content
  • heartbeat reminders or system-driven content can surface into the conversational lane at confusing times
  • voice notes are unreliable in this surface, especially if they arrive while the session is already busy
  • user experience feels like “this keeps happening multiple times” rather than one isolated bug

Why this seems distinct from any single existing issue

There are already several relevant issues:

The problem here is that the combined behavior in Telegram forum topics makes the assistant appear unstable even when each underlying issue is only intermittent. In other words: the composition of these bugs matters.

Local evidence from logs

From local openclaw logs on the affected machine:

1) Repeated ws-stream failures on the same Telegram topic session

Repeated pattern:

  • warn agent/embedded [ws-stream] WebSocket connect failed for session=395a7052-...; falling back to HTTP. error=Error: Unexpected server response: 500

This occurs repeatedly on the affected Telegram topic session and nearby topic sessions.

2) Affected session is a Telegram topic session

Example log lines:

  • workspace bootstrap file MEMORY.md is ... truncating in injected context (sessionKey=agent:main:telegram:group:-1003752945943:topic:72)
  • followed by repeated ws-stream fallback lines for the same session id.

3) Heartbeat is active in the same runtime

Status confirms main heartbeat every 30m while this Telegram topic session is also active.

Reproduction pattern (high-level)

  1. Use OpenClaw in a Telegram group forum topic
  2. Keep main heartbeat enabled
  3. Start a turn that takes long enough for the session to be effectively busy
  4. While busy, send more text and/or a voice note
  5. Allow heartbeat/system-event traffic to continue normally in the same runtime
  6. Observe some mix of:
    • repeated/replayed content
    • stale-looking turn behavior
    • queued voice note arriving without reliable transcription
    • confusing system/heartbeat interference in the session

Expected behavior

  • queued followups should be delivered exactly once
  • final loop termination should not replay prior work just because queued items exist in history
  • Telegram topic chats should handle voice transcription the same as other supported contexts
  • heartbeat/system-event activity should not destabilize the interactive chat lane

Actual behavior

The session can feel unstable in a way that strongly suggests interaction between:

  • followup drain replay
  • loop termination / re-entry logic
  • Telegram topic session handling
  • heartbeat/system-event lane contention
  • queued-media understanding gaps

Hypothesis

A likely root cause is not one isolated bug but an interaction between:

  1. followup queue dedupe/drain weaknesses (Followup queue delivers same message multiple times when agent is busy #30604)
  2. loop termination logic misreading queued history as fresh work ([Bug]: Agent loop does not terminate after final response when Queued messages exist in context — causes full task replay #50956)
  3. queued media understanding gaps (Audio media understanding skipped for followup-queued messages #44682)
  4. Telegram group/topic transcription divergence (Voice transcription not working in group/topic chats #51645)
  5. heartbeat or system-event lane interference ([Bug] "Exec completed" system message causes duplicate user message processing #25959 / [Bug]: Heartbeat handler re-triggers on subagent auto-announcement events, causing cascade of heartbeat polls. #56049)

Request

Please investigate this as a compound Telegram topic session reliability bug rather than only as separate isolated queue/media issues.

If useful, I can provide:

  • exact session/log snippets from the affected Telegram topic session
  • a cleaner reproduction sequence
  • a configuration snapshot (with secrets redacted)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions