mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-07 07:58:36 +00:00
fix(compaction): honor manual keepRecentTokens
This commit is contained in:
@@ -267,6 +267,10 @@ OpenClaw also enforces a safety floor for embedded runs:
|
||||
- Default floor is `20000` tokens.
|
||||
- Set `agents.defaults.compaction.reserveTokensFloor: 0` to disable the floor.
|
||||
- If it’s already higher, OpenClaw leaves it alone.
|
||||
- Manual `/compact` honors an explicit `agents.defaults.compaction.keepRecentTokens`
|
||||
and keeps Pi's recent-tail cut point. Without an explicit keep budget,
|
||||
manual compaction remains a hard checkpoint and rebuilt context starts from
|
||||
the new summary.
|
||||
|
||||
Why: leave enough headroom for multi-turn “housekeeping” (like memory writes) before compaction becomes unavoidable.
|
||||
|
||||
@@ -283,6 +287,10 @@ Plugins can register a compaction provider via `registerCompactionProvider()` on
|
||||
- Setting a `provider` forces `mode: "safeguard"`.
|
||||
- Providers receive the same compaction instructions and identifier-preservation policy as the built-in path.
|
||||
- The safeguard still preserves recent-turn and split-turn suffix context after provider output.
|
||||
- Built-in safeguard summarization re-distills prior summaries with new messages
|
||||
instead of preserving the full previous summary verbatim.
|
||||
- Safeguard mode enables summary quality audits by default; set
|
||||
`qualityGuard.enabled: false` to skip retry-on-malformed-output behavior.
|
||||
- If the provider fails or returns an empty result, OpenClaw falls back to built-in LLM summarization automatically.
|
||||
- Abort/timeout signals are re-thrown (not swallowed) to respect caller cancellation.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user