openclaw - 💡(How to fix) Fix Auto-compaction never fires despite reserveTokens config [1 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

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#68526Fetched 2026-04-19 15:10:36
View on GitHub
Comments
1
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
closed ×1commented ×1

Code Example

"compaction": {
  "mode": "default",
  "reserveTokens": 50000,
  "reserveTokensFloor": 30000
}
RAW_BUFFERClick to expand / collapse

Problem

Auto-compaction does not fire even when context exceeds the configured threshold.

Config:

"compaction": {
  "mode": "default",
  "reserveTokens": 50000,
  "reserveTokensFloor": 30000
}

Expected: Compaction fires at ~150K tokens (200K - 50K reserve) Actual: Session reached 172K/200K (86%) with 10 manual compactions and auto-compaction never triggered.

OC Version: 2026.4.15 Model: anthropic/claude-opus-4-6 (200K context)

Evidence

  • Session ran for ~6 hours across 2 days
  • Context hit 172K/200K confirmed via session_status
  • All 10 compactions were manual (/compact)
  • No compaction-related entries in gateway logs
  • Config verified: reserveTokens=50000 is set correctly

extent analysis

TL;DR

The auto-compaction issue may be resolved by adjusting the compaction configuration, specifically the reserveTokens and reserveTokensFloor settings, to ensure they are correctly aligned with the expected compaction threshold.

Guidance

  • Review the compaction configuration to ensure that the reserveTokens and reserveTokensFloor values are correctly set and aligned with the expected compaction threshold of 150K tokens.
  • Verify that the session status and context size are accurately reported and match the expected values.
  • Check the gateway logs for any errors or warnings related to compaction, even if no compaction-related entries are found, to ensure there are no underlying issues.
  • Consider temporarily reducing the reserveTokens value to a lower threshold to test if auto-compaction triggers as expected.

Example

No code snippet is provided as the issue is related to configuration settings.

Notes

The provided information suggests a configuration or threshold issue, but without further details on the compaction mechanism or the specific requirements of the anthropic/claude-opus-4-6 model, it's challenging to provide a definitive solution.

Recommendation

Apply workaround: Adjust the compaction configuration settings to test if auto-compaction triggers as expected, as the current settings may not be correctly aligned with the expected compaction threshold.

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 never fires despite reserveTokens config [1 comments, 1 participants]