mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
fix(config): compaction.enabled is rejected as invalid config (#114118)
* fix(config): compaction.enabled is rejected as invalid config Setting agents.defaults.compaction.enabled in openclaw.json made the whole config fail to load with "agents.defaults.compaction: Invalid input", so auto-compaction could not be turned off. The runtime already reads the field (SettingsManager.getCompactionEnabled returns settings.compaction?.enabled ?? true, and setCompactionEnabled writes it), and the documented config example in docs/reference/session-management-compaction.md already shows "enabled: true". Only the zod schema was missing the key, and the compaction object is .strict(), so the unknown key rejected the config. Adds enabled to AgentDefaultsSchema and to AgentCompactionConfig. Closes #110065 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * fix(config): wire compaction enablement through runtime Align the accepted compaction.enabled contract across runtime precedence, help, labels, docs, and generated schema baselines. Co-authored-by: Zakaria Rahali <zakariarahali288@gmail.com> * test(config): preserve omitted compaction setting Document the reload lifecycle and lock in project-setting precedence when the OpenClaw config key is absent. Co-authored-by: Zakaria Rahali <zakariarahali288@gmail.com> * refactor(config): centralize compaction runtime override * fix(config): preserve compaction safety guards * fix(scripts): avoid ripgrep in merge fallback * docs(config): refresh current main baseline --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com> Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
@@ -237,6 +237,8 @@ Two additional guards run outside these two triggers:
|
||||
|
||||
OpenClaw enforces a built-in reserve for embedded runs and caps it against the active model context window so it cannot consume the whole prompt budget. This keeps small-context local models from entering compaction from the first token while leaving enough headroom for multi-turn housekeeping such as the memory flush.
|
||||
|
||||
Set `enabled: false` to disable threshold-driven auto-compaction inside the embedded agent runtime. OpenClaw's preflight and overflow-recovery compaction paths remain available, and manual `/compact` continues to work.
|
||||
|
||||
Manual `/compact` honors an explicit `agents.defaults.compaction.keepRecentTokens` and keeps the runtime's recent-tail cut point. Without an explicit keep budget, manual compaction is a hard checkpoint and rebuilt context starts from the new summary.
|
||||
|
||||
When `truncateAfterCompaction` is enabled, OpenClaw rotates the active transcript to a compacted successor after compaction. Branch/restore checkpoint actions use that compacted successor; legacy pre-compaction checkpoint files remain readable while referenced.
|
||||
|
||||
Reference in New Issue
Block a user