openclaw - ✅(Solved) Fix [Bug]: Pre-compaction memory flush leaks into chat UI and blocks the user’s active turn in 2026.3.31 [1 pull requests, 1 comments, 2 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#58956Fetched 2026-04-08 02:30:47
View on GitHub
Comments
1
Participants
2
Timeline
8
Reactions
0
Participants
Timeline (top)
referenced ×4labeled ×2commented ×1cross-referenced ×1

After upgrading to openclaw 2026.3.31, the internal Pre-compaction memory flush prompt is no longer silent. It is rendered directly in the chat window, even though this mechanism is supposed to be an internal housekeeping step.

More importantly, the memory flush can preempt the active user turn. When I send a normal message in a long-running session, OpenClaw sometimes runs the memory flush first, and only then continues with my actual question. This interrupts the conversation flow and makes the UI feel stuck or hijacked by an internal system task.

I did not observe this behavior in 2026.3.28.

Root Cause

After upgrading to openclaw 2026.3.31, the internal Pre-compaction memory flush prompt is no longer silent. It is rendered directly in the chat window, even though this mechanism is supposed to be an internal housekeeping step.

More importantly, the memory flush can preempt the active user turn. When I send a normal message in a long-running session, OpenClaw sometimes runs the memory flush first, and only then continues with my actual question. This interrupts the conversation flow and makes the UI feel stuck or hijacked by an internal system task.

I did not observe this behavior in 2026.3.28.

Fix Action

Fix / Workaround

Upgrade to openclaw 2026.3.31 Open or continue a long session with enough context/history Send normal user messages When the session gets near compaction thresholds, the UI shows Pre-compaction memory flush... The flush may run before the actual user request is answered

PR fix notes

PR #58975: fix(agents): suppress memory flush UI leakage (#58956)

Description (problem / solution / changelog)

Summary

Fix pre-compaction memory flush leaking internal prompts into chat UI and blocking user's active turn.

Root Cause

Memory flush execution increased autoCompactionCount, which triggered:

  1. System event enqueue → displayed via drainFormattedSystemEvents in subsequent turns
  2. Verbose notification → showed "🧹 Auto-compaction complete" to users

Fix

Track performedMemoryFlush flag and suppress UI-visible side effects:

  • Skip enqueueSystemEvent() for memory flush runs
  • Skip verbose notification for memory flush runs

Changes

  • src/auto-reply/reply/agent-runner-memory.ts: Add MemoryFlushResult type, return flag
  • src/auto-reply/reply/agent-runner.ts: Use flag to suppress UI side effects
  • src/auto-reply/reply/agent-runner-memory.flush-leak.test.ts: Add 14 unit tests

Testing

  • ✅ 14 new unit tests (all passing)
  • ✅ 15 existing tests (regression check, all passing)
  • ✅ Build successful

Related

Fixes #58956

Changed files

  • src/auto-reply/reply/agent-runner-memory.flush-leak.test.ts (added, +282/-0)
  • src/auto-reply/reply/agent-runner-memory.ts (modified, +14/-4)
  • src/auto-reply/reply/agent-runner.ts (modified, +3/-1)
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

After upgrading to openclaw 2026.3.31, the internal Pre-compaction memory flush prompt is no longer silent. It is rendered directly in the chat window, even though this mechanism is supposed to be an internal housekeeping step.

More importantly, the memory flush can preempt the active user turn. When I send a normal message in a long-running session, OpenClaw sometimes runs the memory flush first, and only then continues with my actual question. This interrupts the conversation flow and makes the UI feel stuck or hijacked by an internal system task.

I did not observe this behavior in 2026.3.28.

Steps to reproduce

Upgrade to openclaw 2026.3.31 Open or continue a long session with enough context/history Send normal user messages When the session gets near compaction thresholds, the UI shows Pre-compaction memory flush... The flush may run before the actual user request is answered

Expected behavior

Pre-compaction memory flush should remain completely invisible to the user. Internal memory flush runs should not appear as visible chat content. A user’s active message should be handled first. Memory flush should not block or preempt the foreground conversation turn.

Actual behavior

A long internal prompt beginning with Pre-compaction memory flush. appears in the chat UI. During normal conversation, OpenClaw may pause my actual request and run the memory flush first. My question is delayed while the system performs memory housekeeping.

OpenClaw version

2026.3.31

Operating system

mac os 15.6.1

Install method

npm

Model

kimi-2.5

Provider / routing chain

Control UI -> agent -> memory-core flush

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

disrupts conversation continuity confuses users by exposing internal prompts makes long sessions noticeably worse to use

Additional information

No response

extent analysis

TL;DR

Downgrade to openclaw 2026.

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

Pre-compaction memory flush should remain completely invisible to the user. Internal memory flush runs should not appear as visible chat content. A user’s active message should be handled first. Memory flush should not block or preempt the foreground conversation turn.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING