Skip to content

[Bug]: Heartbeat / async system events can interrupt and effectively swallow in-progress replies in Telegram topic sessions #64810

@jackiedepp

Description

@jackiedepp

Summary

In Telegram forum-topic sessions, heartbeat/system-event turns can preempt an in-progress user reply and make the original answer effectively disappear from the user's perspective.

This is not just heartbeat noise. The more serious effect is that a normal user question can get interrupted by heartbeat polls or async System: completion events before the assistant sends its final reply, and the unfinished reply does not automatically resume.

Environment

  • OpenClaw: reproduced across 2026.4.8, 2026.4.9, and 2026.4.10
  • Install: npm/pnpm global install on Ubuntu VPS
  • Surface: Telegram group forum topic session
  • Session shape: persistent main session bound to a Telegram topic

Repro pattern

  1. User sends a normal message in a Telegram topic.
  2. Assistant starts a multi-step response that uses tools or takes long enough to still be in progress.
  3. Before the assistant sends the final user-visible reply, one of these arrives in the same session lane:
    • a heartbeat poll turn
    • an async exec completion / System: tool-completion event
    • a restart/config-patch completion event
  4. The new turn runs first.
  5. The original unfinished user reply does not automatically resume or get replayed.

User-visible result

From the user's point of view, it looks like:

  • the assistant "stopped replying"
  • a HEARTBEAT_OK or unrelated system completion appears instead
  • the original answer is lost unless the user asks again

Why this feels distinct from existing heartbeat issues

There are already related issues about heartbeat/session contamination, but this one is specifically about user reply loss/preemption in the same active Telegram topic session.

Relevant issues I found:

This issue is about the interaction of those classes of bugs with a live user-facing Telegram topic conversation, where heartbeat/system events appear to win the lane and the interrupted reply never comes back.

Current mitigation used locally

I mitigated this locally by changing heartbeat config to:

  • agents.defaults.heartbeat.target = "none"
  • agents.defaults.heartbeat.isolatedSession = true
  • agents.defaults.heartbeat.lightContext = true

That reduces the visible problem a lot, but it feels like a workaround, not a real fix.

Expected behavior

Any of these would be acceptable:

  1. Heartbeat/system-event turns should never preempt an in-progress user-visible reply in the same active session/thread/topic.
  2. If preemption happens, the unfinished reply should automatically resume or be replayed after the system event turn completes.
  3. Async/system completions should be routed into a separate non-preemptive lane for active user conversations.

Actual behavior

Heartbeat/system-event turns can occupy the same conversation lane and cause the original in-progress answer to vanish.

Extra note

Recent routing fixes that correctly send cron/subagent/restart messages back to the original thread/topic may be making this more visible on Telegram topics, because the noisy system events now land in the right place instead of disappearing elsewhere.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.

    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