openclaw - 💡(How to fix) Fix Auto-compaction not triggering despite config (midTurnPrecheck + maxActiveTranscriptBytes)

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…

Auto-compaction does not fire during long sessions, even though the config specifies a 15MB threshold and midTurnPrecheck is enabled. Only manual /compact works.

Root Cause

Auto-compaction does not fire during long sessions, even though the config specifies a 15MB threshold and midTurnPrecheck is enabled. Only manual /compact works.

Code Example

"compaction": {
  "maxActiveTranscriptBytes": "15mb",
  "keepRecentTokens": 30000,
  "notifyUser": true,
  "truncateAfterCompaction": true,
  "midTurnPrecheck": {
    "enabled": true
  }
}
RAW_BUFFERClick to expand / collapse

Description

Auto-compaction does not fire during long sessions, even though the config specifies a 15MB threshold and midTurnPrecheck is enabled. Only manual /compact works.

Config

"compaction": {
  "maxActiveTranscriptBytes": "15mb",
  "keepRecentTokens": 30000,
  "notifyUser": true,
  "truncateAfterCompaction": true,
  "midTurnPrecheck": {
    "enabled": true
  }
}

Observed Behavior

  • Session context grew to ~118k tokens over a long conversation
  • Manual /compact reliably reduces context to ~34k, confirming there's substantial compaction-worthy content
  • openclaw status shows Compactions: 2, but these correspond to my two manual /compact commands — not auto-compactions
  • No compaction notification was ever received despite notifyUser: true
  • Context dropped slightly (118k → 108k) between messages, consistent with cache-ttl pruning, not compaction
  • midTurnPrecheck should catch this mid-conversation but doesn't seem to be triggering

Expected Behavior

  • Auto-compaction should fire when context exceeds the 15MB threshold
  • A notification should be sent to the user when compaction occurs (notifyUser: true)
  • midTurnPrecheck should proactively trigger compaction mid-turn when context is growing too large

Environment

  • OpenClaw 2026.5.27 (27ae826)
  • Model: xiaomi-coding/mimo-v2.5-pro (1M context window)
  • macOS 15.7.5 (x64)
  • Webchat channel

Additional Notes

The session status output showing Compactions: 2 is misleading — it's counting manual compactions, making it look like auto-compaction is working when it isn't. Would be helpful to differentiate manual vs auto compaction counts in status output.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Auto-compaction not triggering despite config (midTurnPrecheck + maxActiveTranscriptBytes)