@martian-engineering/lossless-claw 0.11.3 → 0.12.0

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
@@ -10,6 +10,7 @@ Lossless Context Management plugin for [OpenClaw](https://github.com/openclaw/op
10
10
  - [Commands And Skill](#commands-and-skill)
11
11
  - [Documentation](#documentation)
12
12
  - [Development](#development)
13
+ - [Security](#security)
13
14
  - [License](#license)
14
15
 
15
16
  ## What it does
@@ -152,7 +153,10 @@ Add a `lossless-claw` entry under `plugins.entries` in your OpenClaw config:
152
153
  "summaryModel": "openai/gpt-5.4-mini",
153
154
  "expansionModel": "openai/gpt-5.4-mini",
154
155
  "delegationTimeoutMs": 300000,
155
- "summaryTimeoutMs": 60000
156
+ "summaryTimeoutMs": 60000,
157
+ "summaryCallWindowMs": 600000,
158
+ "summaryMaxCallsPerWindow": 24,
159
+ "summarySpendBackoffMs": 1800000
156
160
  }
157
161
  }
158
162
  }
@@ -160,7 +164,7 @@ Add a `lossless-claw` entry under `plugins.entries` in your OpenClaw config:
160
164
  }
161
165
  ```
162
166
 
163
- `leafChunkTokens` controls how many source tokens can accumulate in a leaf compaction chunk before summarization is triggered. The default is `20000`, but quota-limited summary providers may benefit from a larger value to reduce compaction frequency. `summaryModel` and `summaryProvider` let you request a cheaper or faster compaction model through OpenClaw's `api.runtime.llm.complete` capability; OpenClaw still owns provider dispatch and auth. Explicit summary model requests require `llm.allowModelOverride` and matching `llm.allowedModels` policy entries for `lossless-claw`. `expansionModel` does the same for `lcm_expand_query` sub-agent calls (drilling into summaries to recover detail). `delegationTimeoutMs` controls how long `lcm_expand_query` waits for that delegated sub-agent to finish before returning a timeout error; it defaults to `120000` (120s). `summaryTimeoutMs` controls the per-call timeout for model-backed LCM summarization; it defaults to `60000` (60s). When unset, the model settings still fall back to OpenClaw's configured default model/provider. See [Expansion model override requirements](#expansion-model-override-requirements) for the required `subagent` trust policy when using `expansionModel`.
167
+ `leafChunkTokens` controls how many source tokens can accumulate in a leaf compaction chunk before summarization is triggered. The default is `20000`, but quota-limited summary providers may benefit from a larger value to reduce compaction frequency. `summaryModel` and `summaryProvider` let you request a cheaper or faster compaction model through OpenClaw's `api.runtime.llm.complete` capability; OpenClaw still owns provider dispatch and auth. Explicit summary model requests require `llm.allowModelOverride` and matching `llm.allowedModels` policy entries for `lossless-claw`. `expansionModel` does the same for `lcm_expand_query` sub-agent calls (drilling into summaries to recover detail). `delegationTimeoutMs` controls how long `lcm_expand_query` waits for that delegated sub-agent to finish before returning a timeout error; it defaults to `120000` (120s). `summaryTimeoutMs` controls the per-call timeout for model-backed LCM summarization; it defaults to `60000` (60s). `summaryMaxCallsPerWindow`, `summaryCallWindowMs`, and `summarySpendBackoffMs` bound repeated non-auth summarization spend per session. When unset, the model settings still fall back to OpenClaw's configured default model/provider. See [Expansion model override requirements](#expansion-model-override-requirements) for the required `subagent` trust policy when using `expansionModel`.
164
168
 
165
169
  ### Environment variables
166
170
 
@@ -192,6 +196,9 @@ Add a `lossless-claw` entry under `plugins.entries` in your OpenClaw config:
192
196
  | `LCM_EXPANSION_PROVIDER` | *(from OpenClaw)* | Provider override for `lcm_expand_query` sub-agent |
193
197
  | `LCM_DELEGATION_TIMEOUT_MS` | `120000` | Max time to wait for delegated `lcm_expand_query` sub-agent completion |
194
198
  | `LCM_SUMMARY_TIMEOUT_MS` | `60000` | Max time to wait for a single model-backed LCM summarizer call |
199
+ | `LCM_SUMMARY_CALL_WINDOW_MS` | `600000` | Rolling window used by the per-session summarization spend guard |
200
+ | `LCM_SUMMARY_MAX_CALLS_PER_WINDOW` | `24` | Max model-backed summarization calls per session/window before spend backoff opens |
201
+ | `LCM_SUMMARY_SPEND_BACKOFF_MS` | `1800000` | Cooldown after the summarization spend guard opens |
195
202
  | `LCM_PRUNE_HEARTBEAT_OK` | `false` | Retroactively delete `HEARTBEAT_OK` turn cycles from LCM storage |
196
203
  | `LCM_TRANSCRIPT_GC_ENABLED` | `false` | Enable transcript rewrite GC during `maintain()` |
197
204
  | `LCM_PROACTIVE_THRESHOLD_COMPACTION_MODE` | `deferred` | Choose whether proactive threshold compaction is deferred into maintenance debt or kept inline for legacy behavior |
@@ -293,7 +300,7 @@ For large sessions, neither command is a perfect “keep my live agent context,
293
300
  - `/new` keeps writing into the same active LCM conversation row.
294
301
  - `/reset` changes OpenClaw session flow, which is heavier than users often want when their real problem is just LCM row size.
295
302
 
296
- `/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`.
303
+ `/lcm rotate` fills that gap. Before trimming the transcript, it forces leaf-only compaction for raw context outside the preserved live tail so older transcript messages are represented by LCM summaries. It then 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 durable messages, 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`.
297
304
 
298
305
  `newSessionRetainDepth` (or `LCM_NEW_SESSION_RETAIN_DEPTH`) controls how much summary structure survives `/new`:
299
306
 
@@ -307,6 +314,8 @@ Lossless-claw applies `/new` pruning through `before_reset` and uses `session_en
307
314
 
308
315
  Use `ignoreSessionPatterns` or `LCM_IGNORE_SESSION_PATTERNS` to keep low-value sessions completely out of LCM. Matching sessions do not create conversations, do not store messages, and do not participate in compaction or delegated expansion grants.
309
316
 
317
+ Cron scheduler keys (`agent:<agent>:cron:<job>...`) are isolated automatically when OpenClaw reuses the same `sessionKey` for a new runtime `sessionId`: lossless-claw archives the prior active run and creates a fresh LCM conversation for the new run. Leave cron sessions out of `ignoreSessionPatterns` when they need in-run LCM compaction.
318
+
310
319
  Pattern rules:
311
320
 
312
321
  - `*` matches any characters except `:`
@@ -315,7 +324,7 @@ Pattern rules:
315
324
 
316
325
  Examples:
317
326
 
318
- - `agent:*:cron:**` excludes cron sessions for any agent, including isolated run sessions like `agent:main:cron:daily-digest:run:run-123`
327
+ - `agent:*:cron:**` excludes cron sessions for any agent when you want to bypass LCM entirely
319
328
  - `agent:main:subagent:**` excludes all main-agent subagent sessions
320
329
  - `agent:ops:**` excludes every session under the `ops` agent id
321
330
 
@@ -497,6 +506,11 @@ tui/ # Interactive terminal UI (Go)
497
506
  .goreleaser.yml # GoReleaser config for TUI binary releases
498
507
  ```
499
508
 
509
+ ## Security
510
+
511
+ Please report suspected vulnerabilities privately. See [SECURITY.md](SECURITY.md)
512
+ for the supported disclosure process and response expectations.
513
+
500
514
  ## License
501
515
 
502
516
  MIT