@martian-engineering/lossless-claw 0.8.2 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -33,13 +33,18 @@ Nothing is lost. Raw messages stay in the database. Summaries link back to their
33
33
  The plugin now ships a bundled `lossless-claw` skill plus a small plugin command surface for supported OpenClaw chat/native command providers:
34
34
 
35
35
  - `/lcm` shows version, enablement/selection state, DB path and size, summary counts, and summary-health status
36
+ - `/lcm backup` creates a timestamped backup of the current LCM SQLite database
37
+ - `/lcm rotate` rewrites the active session transcript into a compact tail-preserving form without changing the live OpenClaw session identity or current LCM conversation
36
38
  - `/lcm doctor` scans for broken or truncated summaries
37
39
  - `/lcm doctor clean` shows read-only high-confidence junk diagnostics for archived subagents, cron sessions, and NULL-key orphaned subagent runs
40
+ - `/lcm status` shows plugin, conversation, and maintenance state including deferred compaction debt
38
41
  - `/lossless` is an alias for `/lcm` on supported native command surfaces
39
42
 
40
43
  These are plugin slash/native commands, not root shell CLI subcommands. Supported examples:
41
44
 
42
45
  - `/lcm`
46
+ - `/lcm backup`
47
+ - `/lcm rotate`
43
48
  - `/lcm doctor`
44
49
  - `/lcm doctor clean`
45
50
  - `/lossless`
@@ -124,10 +129,15 @@ Add a `lossless-claw` entry under `plugins.entries` in your OpenClaw config:
124
129
  "newSessionRetainDepth": 2,
125
130
  "contextThreshold": 0.75,
126
131
  "incrementalMaxDepth": 1,
132
+ "cacheAwareCompaction": {
133
+ "enabled": true,
134
+ "cacheTTLSeconds": 300
135
+ },
127
136
  "ignoreSessionPatterns": [
128
137
  "agent:*:cron:**"
129
138
  ],
130
139
  "transcriptGcEnabled": false,
140
+ "proactiveThresholdCompactionMode": "deferred",
131
141
  "summaryModel": "openai/gpt-5.4-mini",
132
142
  "expansionModel": "openai/gpt-5.4-mini",
133
143
  "delegationTimeoutMs": 300000,
@@ -173,8 +183,11 @@ Add a `lossless-claw` entry under `plugins.entries` in your OpenClaw config:
173
183
  | `LCM_SUMMARY_TIMEOUT_MS` | `60000` | Max time to wait for a single model-backed LCM summarizer call |
174
184
  | `LCM_PRUNE_HEARTBEAT_OK` | `false` | Retroactively delete `HEARTBEAT_OK` turn cycles from LCM storage |
175
185
  | `LCM_TRANSCRIPT_GC_ENABLED` | `false` | Enable transcript rewrite GC during `maintain()` |
186
+ | `LCM_PROACTIVE_THRESHOLD_COMPACTION_MODE` | `deferred` | Choose whether proactive threshold compaction is deferred into maintenance debt or kept inline for legacy behavior |
187
+ | `LCM_CACHE_TTL_SECONDS` | `300` | Cache TTL used by cache-aware deferred compaction when provider/runtime telemetry does not supply a more specific retention window |
176
188
 
177
189
  Transcript GC rewrites are disabled by default. Set `transcriptGcEnabled` or `LCM_TRANSCRIPT_GC_ENABLED` to turn them on explicitly.
190
+ Deferred proactive compaction is also the default. Set `proactiveThresholdCompactionMode` or `LCM_PROACTIVE_THRESHOLD_COMPACTION_MODE` to `inline` only if you need legacy foreground compaction behavior. In deferred mode, lossless-claw records one coalesced prompt-mutating debt item after the turn, leaves background `maintain()` to process only non-prompt-mutating work while Anthropic cache is still hot, and then consumes that debt pre-assembly once the cache is cold or the prompt is approaching overflow.
178
191
 
179
192
  ### Expansion model override requirements
180
193
 
@@ -263,6 +276,13 @@ Lossless-claw distinguishes OpenClaw's two session-reset commands:
263
276
  - `/new` keeps the active conversation row and all stored summaries, but prunes `context_items` so the next turn rebuilds context from retained summaries instead of the fresh tail.
264
277
  - `/reset` archives the active conversation row and creates a new active row for the same stable `sessionKey`, giving the next turn a clean LCM conversation while preserving prior history.
265
278
 
279
+ For large sessions, neither command is a perfect “keep my live agent context, but stop writing into this giant active LCM row” tool:
280
+
281
+ - `/new` keeps writing into the same active LCM conversation row.
282
+ - `/reset` changes OpenClaw session flow, which is heavier than users often want when their real problem is just LCM row size.
283
+
284
+ `/lcm rotate` fills that gap. It replaces one rolling `rotate-latest` SQLite backup, rewrites the current session transcript down to the preserved live tail plus current session settings, and refreshes the bootstrap frontier on the same active LCM conversation so dropped transcript history is not replayed. Existing summaries, context items, and conversation identity stay in place; only the transcript backing is compacted. If you want additional timestamped snapshots instead, run `/lcm backup`.
285
+
266
286
  `newSessionRetainDepth` (or `LCM_NEW_SESSION_RETAIN_DEPTH`) controls how much summary structure survives `/new`:
267
287
 
268
288
  - `-1`: keep all existing context items