Skip to content

/compact command reply silently dropped after upgrade to 2026.5.22 (delivered=true but no actual delivery) #87107

@itanyplus

Description

@itanyplus

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

On OpenClaw 2026.5.22, the /compact slash command executes successfully (context is compacted, delivered=true is logged), but the reply text summarizing the compaction result is never delivered to any channel. The message silently disappears in the dispatch pipeline. No error is logged. Additionally, the compaction.notifyUser notification is also silently skipped.

This is a regression from 2026.5.18 where /compact replies were displayed normally on both Feishu and WebChat.

Steps to reproduce

  1. Install OpenClaw 2026.5.22 (upgraded from 2026.5.18).
  2. Accumulate enough conversation context (e.g., 70k+ tokens).
  3. Send /compact from any channel (Feishu DM or WebChat).
  4. Observe: no reply is received. The command appears to be silently consumed.

Expected behavior

The /compact command should return a visible reply to the originating channel, e.g.:

Compacted (76k → 934 tokens)

When compaction.notifyUser is set to true, compaction start/end notifications (🧹 Compacting context... / 🧹 Compaction complete) should also be delivered to the user's chat channel.

Both worked correctly on 2026.5.18.

Actual behavior

Bug 1: Compact reply silently dropped

  • The compaction itself executes correctly (context is reduced).
  • The gateway log shows system command dispatched (delivered=true, elapsed=~1200ms).
  • No deliver: sending text chunks log appears for the compact reply message.
  • No Feishu API call is made to send the reply.
  • The user sees nothing — no success, no error, no feedback of any kind.
  • Both Feishu and WebChat channels are affected.

Bug 2: notifyUser notification short-circuited by else if

When compaction.notifyUser: true is set, the notification is still not delivered. In agent-runner-execution-*.js (lines ~1467–1476), the notification logic uses an else if chain:

if (params.opts?.onCompactionStart) await params.opts.onCompactionStart();
if (hookMessages.length > 0) await sendCompactionHookMessages(hookMessages);
else if (!params.opts?.onCompactionStart && shouldNotifyUserAboutCompaction) await sendCompactionNotice("start");

The sendCompactionNotice call only fires when no internal callbacks are registered and no hookMessages are present. If the system internally registers onCompactionStart/onCompactionEnd (e.g., for Control UI), the user notification is silently skipped — even though the user explicitly opted in.

These serve different audiences and should be independent:

  • Internal callbacks → system/Control UI
  • Hook messages → custom hooks
  • notifyUser → the end user's chat channel

Evidence from gateway logs

Compact command (broken) — Feishu, message om_x100b6e6c0fae1094b2445d34453c189 at 19:29:

19:29:26.439 | message om_x100b6e6c0fae1094b2445d34453c189 — immediate
19:29:26.443 | received from ou_... in oc_... (p2p)
19:29:26.447 | system command detected, plain-text dispatch
19:29:27.639 | system command dispatched (delivered=true, elapsed=1198ms)
                  ← NO "deliver: sending text chunks" log
                  ← NO Feishu API call
                  ← message disappears

Compact command (broken) — Feishu, message om_x100b6e62c1de24acb32a67cbb3eba18 at 17:33:

17:33:37.869 | message om_x100b6e62c1de24acb32a67cbb3eba18 — immediate
17:33:37.872 | received from ou_... in oc_... (p2p)
17:33:37.877 | system command detected, plain-text dispatch
17:33:39.155 | system command dispatched (delivered=true, elapsed=1285ms)
                  ← NO "deliver: sending text chunks" log
                  ← message disappears

Normal user message (working) — Feishu, message om_x100b6e62deba9480b3e272c2d2e57d1 at 17:34:

17:34:00.009 | message om_x100b6e62deba9480b3e272c2d2e57d1 — immediate
17:34:00.014 | received from ou_... in oc_... (p2p)
17:34:00.065 | reply mode resolved (effectiveReplyMode=static, ...)
17:34:00.067 | footer config resolved (...)
17:34:00.069 | dispatching to agent (session=agent:main:feishu:direct:ou_...)
17:34:01.635 | added typing indicator reaction
17:34:24.412 | deliver: sending card chunks (count=1, chatId=oc_...)  ← reply delivered ✅
17:34:25.331 | dispatch complete (replies=1, elapsed=25320ms)

The key difference: compact messages stop after system command dispatched (delivered=true). Normal messages proceed through dispatching to agentdeliver: sending text chunksdispatch complete (replies=1).

Source code analysis

The compact reply is generated in handleCompactCommand (commands-handlers.runtime-05Qv0Bh1.js, line 1676+). The handler correctly produces reply text and invokes the deliver callback. However, in the dispatch pipeline (deliverOutboundPayloads), the reply appears to hit an early-return branch that skips the actual channel adapter invocation. Since deliverySucceeded defaults to !deliveryHadError and no error was set, the result is delivered=true with no actual delivery.

This is the same root cause pattern as #79753 (cron announce delivered=true but message never arrives).

For the notifyUser issue, the suggested fix is to change the else if to an independent if:

if (params.opts?.onCompactionEnd) await params.opts.onCompactionEnd();
if (hookMessages.length > 0) await sendCompactionHookMessages(hookMessages);
if (shouldNotifyUserAboutCompaction) await sendCompactionNotice("end");  // always fire if enabled

Suspected 2026.5.22 changes

The following changes in 2026.5.22 may be related:

Workaround

None found. The compaction result is lost silently. Users can verify compaction happened by checking /status for context size changes, but receive no feedback from the /compact command itself.

OpenClaw version

2026.5.22 (a374c3a)

Operating system

Ubuntu 26.04 LTS (Linux 7.0.0-15-generic x86_64)

Install method

npm global

Model

zhipuai/glm-5.1 (default), also reproduced with kuaipao-gpt/gpt-5.5

Provider / routing chain

zhipuai/glm-5.1 → gateway

Additional provider/model setup details

N/A — bug is in dispatch pipeline, independent of model/provider.

Impact and severity

  • Affected: All users who rely on /compact to manage context and expect feedback.
  • Severity: Medium. Compaction still works functionally, but the silent failure makes users think the command did nothing, leading to repeated attempts and confusion.
  • Frequency: Every /compact invocation on every channel.
  • Consequence: User confusion, duplicate compact attempts, loss of trust in the slash command system. In automated workflows, the absence of a compaction summary prevents downstream logic from confirming success.

Additional information

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.

    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