openclaw - 💡(How to fix) Fix Recurring bug: compaction status is emitted into Telegram user-facing output and final reply is not delivered [1 comments, 1 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#56801Fetched 2026-04-08 01:47:39
View on GitHub
Comments
1
Participants
1
Timeline
1
Reactions
0
Timeline (top)
commented ×1

In Telegram DM, the user sometimes receives the internal message 🧹 Compacting context... during normal reply generation. This is not a one-time event: it has been observed multiple times.

Error Message

  • User sees: 🧹 Compacting context...
  • After that, the actual reply is not delivered
  • This has happened repeatedly, so it appears to be a recurring bug rather than an isolated glitch

Root Cause

In Telegram DM, the user sometimes receives the internal message 🧹 Compacting context... during normal reply generation. This is not a one-time event: it has been observed multiple times.

RAW_BUFFERClick to expand / collapse

Summary

In Telegram DM, the user sometimes receives the internal message 🧹 Compacting context... during normal reply generation. This is not a one-time event: it has been observed multiple times.

Problem

An internal compaction/progress event is leaking into the normal outbound chat path. After 🧹 Compacting context... appears, the actual assistant reply is not delivered to the user.

Expected behavior

Internal compaction lifecycle/progress messages must never be visible in user-facing chats. If compaction happens during reply generation, it should remain fully internal and the final assistant message must still be delivered normally.

Observed behavior

  • User sees: 🧹 Compacting context...
  • After that, the actual reply is not delivered
  • This has happened repeatedly, so it appears to be a recurring bug rather than an isolated glitch

Likely fault domains

  • compaction event incorrectly classified as outbound content
  • reply pipeline aborts or loses the final message after compaction
  • Telegram adapter fails to filter internal progress/status events
  • reply assembly breaks across compaction boundary

Acceptance criteria

  • 🧹 Compacting context... never reaches Telegram chat
  • final reply is still delivered even if compaction occurs mid-response
  • internal lifecycle events remain only in logs/traces
  • no silent loss of assistant replies at compaction boundaries

extent analysis

Fix Plan

The fix involves modifying the reply pipeline to filter out internal compaction events and ensure that the final assistant message is delivered even if compaction occurs during reply generation.

  • Modify the Telegram adapter to filter out internal progress/status events:
def filter_internal_events(message):
    if message.startswith('🧹 Compacting context...'):
        return None
    return message
  • Implement a retry mechanism to ensure that the final assistant message is delivered:
def send_reply(message):
    try:
        # Send the reply
        telegram_adapter.send(message)
    except Exception as e:
        # Retry sending the reply if it fails
        logging.error(f"Error sending reply: {e}")
        send_reply(message)
  • Modify the reply assembly to handle compaction boundaries:
def assemble_reply(messages):
    # Filter out internal compaction events
    messages = [m for m in messages if not m.startswith('🧹 Compacting context...')]
    # Assemble the final reply
    return '\n'.join(messages)

Verification

To verify that the fix worked, test the following scenarios:

  • Send a message to the Telegram chat and verify that the 🧹 Compacting context... message is not visible.
  • Trigger compaction during reply generation and verify that the final assistant message is still delivered.
  • Check the logs/traces to ensure that internal lifecycle events are not visible in the user-facing chat.

Extra Tips

  • Ensure that the Telegram adapter is properly configured to filter out internal progress/status events.
  • Monitor the logs/traces to detect any silent loss of assistant replies at compaction boundaries.
  • Consider implementing additional logging and monitoring to detect and prevent similar issues in the future.

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…

FAQ

Expected behavior

Internal compaction lifecycle/progress messages must never be visible in user-facing chats. If compaction happens during reply generation, it should remain fully internal and the final assistant message must still be delivered normally.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING