openclaw - 💡(How to fix) Fix [Feature]: Percentage-based compaction config [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#72790Fetched 2026-04-28 06:32:08
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
labeled ×1

Percentage-based compaction config.

Root Cause

Percentage-based compaction config.

RAW_BUFFERClick to expand / collapse

Summary

Percentage-based compaction config.

Problem to solve

Current compaction settings like reserveTokensFloor and keepRecentTokens use absolute token values. This creates inconsistent behavior across models with different context windows.

Example: reserveTokensFloor: 20000 means:

  • 62% of a 32k context window (Claude 3 Opus)
  • 10% of a 200k context window (Claude 3.5 Sonnet)

Same config, wildly different behavior.

Proposed solution

Add support for percentage values in context-aware token settings:

{
  "agents": {
    "defaults": {
      "compaction": {
        "reserveTokensFloor": "10%",
        "keepRecentTokens": "15%"
      }
    }
  }
}

### Alternatives considered

Auto-scale the default floor as % of context window, even if user sets absolute number.

### Impact

Config becomes portable across models
Users think in relative terms ("leave 10% headroom") not absolute numbers
Reduces per-model config maintenance

### Evidence/examples

_No response_

### Additional information

_No response_

extent analysis

TL;DR

Implement percentage-based compaction configuration to ensure consistent behavior across models with different context windows.

Guidance

  • Update the compaction settings to use percentage values, such as "reserveTokensFloor": "10%" and "keepRecentTokens": "15%", to make the config portable across models.
  • Verify the new configuration by testing it with different context window sizes to ensure the desired behavior.
  • Consider auto-scaling the default floor as a percentage of the context window, even if the user sets an absolute number, as an alternative solution.
  • Review the impact of the new configuration on per-model config maintenance and user experience.

Example

{
  "agents": {
    "defaults": {
      "compaction": {
        "reserveTokensFloor": "10%",
        "keepRecentTokens": "15%"
      }
    }
  }
}

Notes

The proposed solution assumes that the system can parse and apply percentage values correctly. Additional testing may be necessary to ensure the new configuration works as expected.

Recommendation

Apply workaround: Implement percentage-based compaction configuration to ensure consistent behavior across models with different context windows, as it provides a more flexible and user-friendly solution.

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 [Feature]: Percentage-based compaction config [1 participants]