@martian-engineering/lossless-claw 0.11.0 → 0.11.2
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/dist/index.js +6 -6
- package/docs/agent-tools.md +8 -4
- package/docs/configuration.md +11 -1
- package/openclaw.plugin.json +24 -0
- package/package.json +1 -1
- package/skills/lossless-claw/references/config.md +54 -0
package/docs/agent-tools.md
CHANGED
|
@@ -124,6 +124,7 @@ When `allConversations: true` is set, `lcm_expand_query` can now synthesize one
|
|
|
124
124
|
| `query` | string | ✅* | — | Text query to find summaries (if no `summaryIds`) |
|
|
125
125
|
| `summaryIds` | string[] | ✅* | — | Specific summary IDs to expand (if no `query`) |
|
|
126
126
|
| `maxTokens` | number | | 2000 | Answer length cap |
|
|
127
|
+
| `timeoutMs` | number | ✅ | `delegationTimeoutMs + 30000` | Total OpenClaw dynamic tool RPC timeout; use the schema default so delegated recall can finish before the host watchdog fires |
|
|
127
128
|
| `conversationId` | number | | current session family | Scope to a specific physical conversation |
|
|
128
129
|
| `allConversations` | boolean | | `false` | Search across all conversations |
|
|
129
130
|
|
|
@@ -144,20 +145,23 @@ When `allConversations: true` is set, `lcm_expand_query` can now synthesize one
|
|
|
144
145
|
# Find and expand summaries about a topic
|
|
145
146
|
lcm_expand_query(
|
|
146
147
|
query: "OAuth authentication fix",
|
|
147
|
-
prompt: "What was the root cause and what commits fixed it?"
|
|
148
|
+
prompt: "What was the root cause and what commits fixed it?",
|
|
149
|
+
timeoutMs: 150000
|
|
148
150
|
)
|
|
149
151
|
|
|
150
152
|
# Expand specific summaries you already have
|
|
151
153
|
lcm_expand_query(
|
|
152
154
|
summaryIds: ["sum_abc123", "sum_def456"],
|
|
153
|
-
prompt: "What were the exact file changes?"
|
|
155
|
+
prompt: "What were the exact file changes?",
|
|
156
|
+
timeoutMs: 150000
|
|
154
157
|
)
|
|
155
158
|
|
|
156
159
|
# Cross-conversation synthesis
|
|
157
160
|
lcm_expand_query(
|
|
158
161
|
query: "deployment procedure",
|
|
159
162
|
prompt: "What's the current deployment process?",
|
|
160
|
-
allConversations: true
|
|
163
|
+
allConversations: true,
|
|
164
|
+
timeoutMs: 150000
|
|
161
165
|
)
|
|
162
166
|
```
|
|
163
167
|
|
|
@@ -193,6 +197,6 @@ By default, tools operate on the current session family: the active conversation
|
|
|
193
197
|
|
|
194
198
|
- `lcm_grep` and `lcm_describe` are fast (direct database queries)
|
|
195
199
|
- `lcm_expand_query` spawns a sub-agent and takes ~30–120 seconds
|
|
196
|
-
- The sub-agent has a 120-second timeout with cleanup guarantees
|
|
200
|
+
- The sub-agent has a 120-second timeout with cleanup guarantees by default, and the tool schema advertises a 150-second OpenClaw dynamic RPC timeout so the host watchdog stays open long enough for delegated recall plus result cleanup
|
|
197
201
|
- Token caps (`LCM_MAX_EXPAND_TOKENS`) prevent runaway expansion
|
|
198
202
|
- Cross-conversation `lcm_expand_query` expands only a bounded set of top-ranked conversations
|
package/docs/configuration.md
CHANGED
|
@@ -33,6 +33,9 @@ Most installations only need to override a handful of keys. If you want a comple
|
|
|
33
33
|
"incrementalMaxDepth": 1,
|
|
34
34
|
"leafChunkTokens": 20000,
|
|
35
35
|
"summaryPrefixTargetTokens": 20000,
|
|
36
|
+
"maxSweepIterations": 12,
|
|
37
|
+
"sweepDeadlineMs": 120000,
|
|
38
|
+
"compactUntilUnderDeadlineMs": 300000,
|
|
36
39
|
"bootstrapMaxTokens": 6000,
|
|
37
40
|
"leafTargetTokens": 2400,
|
|
38
41
|
"condensedTargetTokens": 2000,
|
|
@@ -156,6 +159,9 @@ Every automatic decision emits grep-able log lines prefixed with `[lcm] auto-rot
|
|
|
156
159
|
| `incrementalMaxDepth` | `integer` | alias of `sweepMaxDepth` | `LCM_INCREMENTAL_MAX_DEPTH` | Deprecated alias for `sweepMaxDepth`. Kept so existing configs continue to load. |
|
|
157
160
|
| `leafChunkTokens` | `integer` | `20000` | `LCM_LEAF_CHUNK_TOKENS` | Maximum source-token budget for a leaf compaction chunk. Larger chunks reduce sweep frequency at the cost of slower individual summary calls. |
|
|
158
161
|
| `summaryPrefixTargetTokens` | `integer` | derived | `LCM_SUMMARY_PREFIX_TARGET_TOKENS` | Optional target for summarized-prefix tokens after a full sweep. If unset, Lossless derives `max(condensedTargetTokens, min(leafChunkTokens, floor(contextThreshold * tokenBudget * 0.5)))`. |
|
|
162
|
+
| `maxSweepIterations` | `integer` | `12` | `LCM_MAX_SWEEP_ITERATIONS` | Hard cap on summarizer passes within a single full sweep. On hitting the cap the sweep stops cleanly and returns the partial result; bounds how long a sweep can run on the turn-critical path. |
|
|
163
|
+
| `sweepDeadlineMs` | `integer` | `120000` | `LCM_SWEEP_DEADLINE_MS` | Wall-clock budget for a single full sweep, in milliseconds. When exceeded the sweep stops before starting another pass, so a slow or rate-limited summarizer cannot hang the agent turn. |
|
|
164
|
+
| `compactUntilUnderDeadlineMs` | `integer` | `300000` | `LCM_COMPACT_UNTIL_UNDER_DEADLINE_MS` | Wall-clock budget for a whole `compactUntilUnder` operation, in milliseconds. `compactUntilUnder` runs up to `maxRounds` sweeps; without this the worst case is `maxRounds × sweepDeadlineMs` (~20 min at the defaults). The deadline is shared into each round's sweep and checked before the next round. |
|
|
159
165
|
| `bootstrapMaxTokens` | `integer` | `max(6000, floor(leafChunkTokens * 0.3))` | `LCM_BOOTSTRAP_MAX_TOKENS` | Maximum parent-history tokens imported when a new LCM conversation bootstraps. |
|
|
160
166
|
| `leafTargetTokens` | `integer` | `2400` | `LCM_LEAF_TARGET_TOKENS` | Prompt target for leaf summary size. |
|
|
161
167
|
| `condensedTargetTokens` | `integer` | `2000` | `LCM_CONDENSED_TARGET_TOKENS` | Prompt target for condensed summary size. |
|
|
@@ -175,7 +181,7 @@ Every automatic decision emits grep-able log lines prefixed with `[lcm] auto-rot
|
|
|
175
181
|
| `largeFileSummaryProvider` | `string` | `""` | `LCM_LARGE_FILE_SUMMARY_PROVIDER` | Large-file summarizer provider hint for bare model names. |
|
|
176
182
|
| `expansionModel` | `string` | `""` | `LCM_EXPANSION_MODEL` | `lcm_expand_query` sub-agent model override. |
|
|
177
183
|
| `expansionProvider` | `string` | `""` | `LCM_EXPANSION_PROVIDER` | `lcm_expand_query` sub-agent provider hint for bare model names. |
|
|
178
|
-
| `delegationTimeoutMs` | `integer` | `120000` | `LCM_DELEGATION_TIMEOUT_MS` | Maximum time to wait for delegated expansion work. |
|
|
184
|
+
| `delegationTimeoutMs` | `integer` | `120000` | `LCM_DELEGATION_TIMEOUT_MS` | Maximum time to wait for delegated expansion work. `lcm_expand_query` advertises a dynamic tool `timeoutMs` default with 30 seconds of extra RPC headroom so OpenClaw's tool watchdog does not fire before this wait completes. |
|
|
179
185
|
| `summaryTimeoutMs` | `integer` | `60000` | `LCM_SUMMARY_TIMEOUT_MS` | Maximum time to wait for one model-backed summarizer call. |
|
|
180
186
|
| `customInstructions` | `string` | `""` | `LCM_CUSTOM_INSTRUCTIONS` | Extra natural-language instructions injected into every summarization prompt. |
|
|
181
187
|
|
|
@@ -223,6 +229,10 @@ Lossless still records prompt-cache telemetry for status and diagnostics, but ca
|
|
|
223
229
|
|
|
224
230
|
Full sweeps first run leaf passes until there are no more eligible raw-message chunks outside the fresh tail. Condensation is then driven by summarized-prefix pressure: the routine condensation phase obeys `sweepMaxDepth`, and if the summarized prefix still exceeds `summaryPrefixTargetTokens`, a pressure phase may use `condensedMinFanoutHard` and condense deeper. Total context pressure starts the sweep, but does not by itself force deeper condensation once the raw prefix has been summarized.
|
|
225
231
|
|
|
232
|
+
A single sweep is bounded by both `maxSweepIterations` (a hard cap on summarizer passes) and `sweepDeadlineMs` (a wall-clock budget). When either limit is reached the sweep stops before starting another pass and returns the consistent partial result built so far, logging a `compactFullSweep stopped at …` warning. This keeps a slow or rate-limited summarizer from hanging the agent turn — remaining context pressure is picked up by the next sweep.
|
|
233
|
+
|
|
234
|
+
Overflow recovery (`compactUntilUnder`) runs up to `maxRounds` sweeps to drive context under a target. Because every sweep re-arms its own `sweepDeadlineMs`, the whole operation is separately bounded by `compactUntilUnderDeadlineMs` (default 300000): the operation deadline is shared into each round's sweep — a sweep stops at whichever deadline is sooner — and is also checked before starting the next round. On hitting it, `compactUntilUnder` returns the consistent partial result and logs a `compactUntilUnder stopped at …` warning, so the worst case is the operation budget rather than `maxRounds × sweepDeadlineMs`.
|
|
235
|
+
|
|
226
236
|
### Prompt-aware eviction
|
|
227
237
|
|
|
228
238
|
When `promptAwareEviction` is enabled:
|
package/openclaw.plugin.json
CHANGED
|
@@ -56,6 +56,18 @@
|
|
|
56
56
|
"label": "Summary Prefix Target Tokens",
|
|
57
57
|
"help": "Optional target for summarized-prefix tokens after a full sweep. When omitted, Lossless derives a pressure target from contextThreshold and leafChunkTokens."
|
|
58
58
|
},
|
|
59
|
+
"maxSweepIterations": {
|
|
60
|
+
"label": "Max Sweep Iterations",
|
|
61
|
+
"help": "Hard cap on summarizer passes within a single full compaction sweep (default 12). Bounds how long a sweep can run on the turn-critical path; on hitting the cap the sweep stops cleanly with a partial result."
|
|
62
|
+
},
|
|
63
|
+
"sweepDeadlineMs": {
|
|
64
|
+
"label": "Sweep Deadline (ms)",
|
|
65
|
+
"help": "Wall-clock budget for a single full compaction sweep, in milliseconds (default 120000). When exceeded the sweep stops before starting another pass, so a slow or rate-limited summarizer cannot hang the agent turn."
|
|
66
|
+
},
|
|
67
|
+
"compactUntilUnderDeadlineMs": {
|
|
68
|
+
"label": "Compact-Until-Under Deadline (ms)",
|
|
69
|
+
"help": "Wall-clock budget for a whole compact-until-under operation, in milliseconds (default 300000). A compact-until-under run executes several sweeps; this caps the total so it cannot run maxRounds times the per-sweep deadline (~20 minutes at defaults)."
|
|
70
|
+
},
|
|
59
71
|
"bootstrapMaxTokens": {
|
|
60
72
|
"label": "Bootstrap Max Tokens",
|
|
61
73
|
"help": "Maximum raw parent-history tokens imported into a brand-new conversation bootstrap; oldest turns are dropped first"
|
|
@@ -295,6 +307,18 @@
|
|
|
295
307
|
"type": "integer",
|
|
296
308
|
"minimum": 1
|
|
297
309
|
},
|
|
310
|
+
"maxSweepIterations": {
|
|
311
|
+
"type": "integer",
|
|
312
|
+
"minimum": 1
|
|
313
|
+
},
|
|
314
|
+
"sweepDeadlineMs": {
|
|
315
|
+
"type": "integer",
|
|
316
|
+
"minimum": 1
|
|
317
|
+
},
|
|
318
|
+
"compactUntilUnderDeadlineMs": {
|
|
319
|
+
"type": "integer",
|
|
320
|
+
"minimum": 1
|
|
321
|
+
},
|
|
298
322
|
"bootstrapMaxTokens": {
|
|
299
323
|
"type": "integer",
|
|
300
324
|
"minimum": 1
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@martian-engineering/lossless-claw",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.2",
|
|
4
4
|
"description": "Lossless Context Management plugin for OpenClaw — DAG-based conversation summarization with threshold compaction",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -163,6 +163,36 @@ Why it matters:
|
|
|
163
163
|
- When unset, Lossless derives a target from `contextThreshold`, the active token budget, and `leafChunkTokens`.
|
|
164
164
|
- Sweeps first exhaust eligible raw-message leaf chunks, then honor `sweepMaxDepth`; pressure condensation can go deeper only when summary-prefix pressure remains.
|
|
165
165
|
|
|
166
|
+
### `maxSweepIterations`
|
|
167
|
+
|
|
168
|
+
Hard cap on summarizer passes within a single full sweep. Default `12`.
|
|
169
|
+
|
|
170
|
+
Why it matters:
|
|
171
|
+
|
|
172
|
+
- A large conversation can otherwise drive an unbounded number of leaf/condensed passes in one sweep.
|
|
173
|
+
- On hitting the cap the sweep stops cleanly and returns the partial result; the next sweep resumes the remaining work.
|
|
174
|
+
- Bounds how long a sweep can run on the turn-critical path (the `assemble()` deferred-debt drain).
|
|
175
|
+
|
|
176
|
+
### `sweepDeadlineMs`
|
|
177
|
+
|
|
178
|
+
Wall-clock budget for a single full sweep, in milliseconds. Default `120000`.
|
|
179
|
+
|
|
180
|
+
Why it matters:
|
|
181
|
+
|
|
182
|
+
- A slow or rate-limited summarizer can burn a full `summaryTimeoutMs` per pass; without a deadline, many passes compound into tens of minutes.
|
|
183
|
+
- When the deadline is exceeded the sweep stops before starting another pass and returns the partial result.
|
|
184
|
+
- Pairs with `maxSweepIterations`: whichever limit is reached first stops the sweep.
|
|
185
|
+
|
|
186
|
+
### `compactUntilUnderDeadlineMs`
|
|
187
|
+
|
|
188
|
+
Wall-clock budget for a whole `compactUntilUnder` (overflow recovery) operation, in milliseconds. Default `300000`.
|
|
189
|
+
|
|
190
|
+
Why it matters:
|
|
191
|
+
|
|
192
|
+
- `compactUntilUnder` runs up to `maxRounds` sweeps, and each sweep re-arms its own `sweepDeadlineMs`; without an operation-wide budget the worst case is `maxRounds × sweepDeadlineMs` (~20 minutes at the defaults).
|
|
193
|
+
- The deadline is shared into each round's sweep — a sweep stops at whichever deadline is sooner — and is also checked before starting the next round.
|
|
194
|
+
- On hitting it, `compactUntilUnder` returns the consistent partial result; the default leaves room for a few full-deadline sweeps while capping the worst case well below 20 minutes.
|
|
195
|
+
|
|
166
196
|
### `incrementalMaxDepth`
|
|
167
197
|
|
|
168
198
|
Deprecated alias for `sweepMaxDepth`.
|
|
@@ -386,6 +416,30 @@ Env override:
|
|
|
386
416
|
|
|
387
417
|
- `LCM_SUMMARY_PREFIX_TARGET_TOKENS`
|
|
388
418
|
|
|
419
|
+
### `maxSweepIterations`
|
|
420
|
+
|
|
421
|
+
See high-impact settings above.
|
|
422
|
+
|
|
423
|
+
Env override:
|
|
424
|
+
|
|
425
|
+
- `LCM_MAX_SWEEP_ITERATIONS`
|
|
426
|
+
|
|
427
|
+
### `sweepDeadlineMs`
|
|
428
|
+
|
|
429
|
+
See high-impact settings above.
|
|
430
|
+
|
|
431
|
+
Env override:
|
|
432
|
+
|
|
433
|
+
- `LCM_SWEEP_DEADLINE_MS`
|
|
434
|
+
|
|
435
|
+
### `compactUntilUnderDeadlineMs`
|
|
436
|
+
|
|
437
|
+
See high-impact settings above.
|
|
438
|
+
|
|
439
|
+
Env override:
|
|
440
|
+
|
|
441
|
+
- `LCM_COMPACT_UNTIL_UNDER_DEADLINE_MS`
|
|
442
|
+
|
|
389
443
|
### `incrementalMaxDepth`
|
|
390
444
|
|
|
391
445
|
Deprecated alias for `sweepMaxDepth`.
|