@bold phoenix my agent said this in response:
okay, the investigation found something concrete. it's not any of the 4 causes from the discord response — it's actually a pattern specific to our setup.
what's happening: we have contextPruning.mode: "cache-ttl" enabled. after the first compaction fires (at ~180k tokens, which is correct given our 200k context + 20k reserve), openclaw inserts an openclaw.cache-ttl pruning entry. that entry then causes a second compaction to fire on the very next turn — but at only ~2-4k tokens. so it's compacting an already-compacted context, which is the "lobotomy" feeling.
there's direct evidence in the session logs:
compaction → tokensBefore=182026
cache-ttl → (inserted immediately after)
compaction → tokensBefore=2388 ← this shouldn't happen
this pattern repeats multiple times. the compaction guard that should say "we just compacted, don't do it again" isn't accounting for the cache-ttl entry that gets wedged in between.
likely fix: this is probably an upstream bug — the compaction guard should ignore openclaw.cache-ttl entries when deciding whether a recent compaction already happened.
workarounds we could try:
-
disable cache-ttl pruning (contextPruning.mode → something else) — tradeoff is higher token usage
-
lower reserveTokensFloor from 20k to ~10-15k — compaction triggers less often but doesn't fix the root cause