
## 2026-04-27 15:01 EDT - Pre-compaction durable memory flush

- MEMORY.md was trimmed earlier today because it exceeded bootstrap limits (~20,447 bytes). Backup kept at `/home/isthekid/.openclaw/workspace/MEMORY.md.bak-2026-04-27`; active `/home/isthekid/.openclaw/workspace/MEMORY.md` rewritten to ~9,471 bytes, below 10k/12k bootstrap threshold. Preserved critical operational rules for email, boards, mailroom, BMC, Blue Prism, DocuSign, Trinity/Morpheus infra, OpenClaw model routing, lossless-claw, and MRAV.
- OpenClaw/Mr Anderson reliability posture confirmed after outage: primary model route should be `openai/gpt-5.5` via OpenAI API key; fallbacks are `openai-codex/gpt-5.4` and `xai/grok-4-1-fast-non-reasoning`. OAuth/Codex quota warnings are not fatal if fallback succeeds. Grok is poor as daily operator; use only last resort or narrow structured tasks.
- Apr 25 outage context: after context overflow/compaction issues, OpenAI Codex weekly OAuth quota was exhausted; outage lasted about 2 days. OAuth should recover after quota reset/cooldown. Primary API-key route restored normal operation.
- Investigated `@martian-engineering/lossless-claw` 0.9.2 due Apr 25 fatal context overflow after gateway restart. Current actual local package at `/home/isthekid/.openclaw/extensions/lossless-claw/package.json` reports version 0.9.2, despite OpenClaw install metadata still saying 0.5.3. npm latest also 0.9.2, published 2026-04-19.
- Current OpenClaw config for lossless-claw: plugin enabled, `plugins.slots.contextEngine = "lossless-claw"`, `freshTailCount = 32`, `contextThreshold = 0.75`, `incrementalMaxDepth = -1`. Config file `/home/isthekid/.openclaw/openclaw.json` valid with no warnings/issues when inspected.
- lossless-claw 0.9.2 investigation finding: compared versions showed 0.9.2 introduced a bootstrap/session-file rollover fallback not present in 0.9.0/0.9.1. New path detects reset/rollover without prior lifecycle split and calls `applySessionReplacement(...)` with reason `"bootstrap session-file rollover fallback"`. This is a startup/restore behavior change even though changelog/web result did not explicitly call out “session restore.”
- Incident evidence: Apr 25/26 overflow in session `53bb0160-24b9-40bd-8fc8-23db1cf3bca1` trajectory showed repeated precheck errors `Context overflow: prompt too large for the model (precheck)`, `compactionCount: 0`, and context.compiled events up to ~1,111,174 original bytes. Snapshot began with large XML summary nodes, including depth=2 summary `sum_291d1eb084d309c7` spanning Apr 1-Apr 12. Archived ratelimit session file `/home/isthekid/.openclaw/agents/main/sessions/archived/53bb0160-ratelimit-20260427-131404.jsonl` was ~22 MB with thousands of historical entries.
- Interpretation given to Adner: failure was likely not the new user prompt; it was restored historical/summary context assembling too large before model execution. Since failure happened at precheck with zero compaction, normal model-side/compaction recovery never ran.
- Recommended but not yet applied lossless-claw mitigation config: `freshTailCount: 16`, `contextThreshold: 0.55`, `incrementalMaxDepth: 1`, `maxAssemblyTokenBudget: 180000`. Rationale: reduce raw tail exposure, compact earlier, avoid unlimited incremental cascade, and cap assembled prompt below ~252k model budget. After applying, restart and run `/lcm`/`/lossless`, monitor `current_token_count` and maintenance.
- Important lossless-claw defaults/behavior from docs/source: 0.9.2 default `freshTailCount=64`, `contextThreshold=0.75`, `incrementalMaxDepth=1`, `leafChunkTokens=20000`, `bootstrapMaxTokens=max(6000, floor(leafChunkTokens*0.3))`, proactive threshold compaction defaults to `deferred`, cacheAwareCompaction enabled, dynamicLeafChunkTokens enabled. `-1` for incrementalMaxDepth means unlimited cascading and is more aggressive than current practical default.
- Session lifecycle details from current package/source: `/new` prunes current LCM conversation by `newSessionRetainDepth`; `/reset` archives active conversation and creates fresh active row; `/lcm rotate` rewrites current transcript tail with rolling backup but keeps same active LCM conversation and summaries/context. Bootstrap uses checkpointing and reconcileSessionTail with import caps; fresh tail is always preserved during assembly even if it exceeds budget unless `freshTailMaxTokens` is set.
