# OpenClaw Compaction Configuration — FINAL **Date:** 2026-04-21 14:24 UTC **Status:** ✅ Applied and Verified **Directive:** Option 3 — Revert to default 20K reserve with 128K ceiling --- ## Configuration Applied ### Compaction Settings (`agents.defaults.compaction`) ```json { "compaction": { "mode": "safeguard", "reserveTokensFloor": 20000, "reserveTokens": 20000, "keepRecentTokens": 10000, "recentTurnsPreserve": 6, "maxHistoryShare": 0.8, "memoryFlush": { "enabled": true, "softThresholdTokens": 5000 }, "postIndexSync": "async", "qualityGuard": { "enabled": false } } } ``` ### Per-Agent Context Tokens | Agent | contextTokens | |-------|---------------| | main (Wadsworth) | 128000 | | socrates | 128000 | | daedalus | 128000 | --- ## Compaction Behavior **Trigger Threshold:** ~108K tokens used (128K - 20K reserve) **Reserve Allocation:** - 20K tokens reserved for Socrates's code block outputs - Prevents hitting absolute API ceiling (128K) - Safeguard mode preserves recent context aggressively **Why 20K:** - Socrates outputs large code blocks (Python, SQL, configs) - 20K buffer = ~15K code + 5K tool results/response - Prevents mid-generation truncation --- ## Session Status **Gateway:** ✅ Live (port 18789) **Current Sessions:** - Main: 127 sessions (including current) - Socrates: 30 sessions (including quarantined) - Daedalus: 43 sessions (including quarantined) **Fresh Sessions:** New sessions will pick up configuration automatically. Existing sessions continue with previous settings until reset. --- ## Optimizations vs Default | Setting | Default | Applied | Effect | |---------|---------|---------|--------| | `reserveTokensFloor` | 20000 | 20000 | ✅ As specified | | `reserveTokens` | 20000 | 20000 | ✅ As specified | | `keepRecentTokens` | ~8000 | 10000 | +2K recent context | | `recentTurnsPreserve` | 3 | 6 | +3 turns verbatim | | `maxHistoryShare` | 0.5 | 0.8 | +30% history budget | **Result:** Same compaction threshold (~108K), but better context preservation during compaction. --- ## Files Modified - `/home/hoffmann_admin/.openclaw/openclaw.json` - Added `agents.defaults.compaction` section - Added `contextTokens: 128000` to all three agents --- ## Sovereign Constraint (Active) Per MEMORY.md directive: > "While the agents run in the cloud, the software they build must be designed for local execution." - Blog Content Engine → local 3080 Ti (phi4, qwen3-vl) - wRVU Dashboard → local models via Tailscale - Cloud = bootstrap; Local = target --- ## Gateway Status ``` $ curl http://127.0.0.1:18789/health {"ok":true,"status":"live"} ``` Configuration loaded. New sessions will use 20K reserve / 128K ceiling.