@xdarkicex/openclaw-memory-libravdb 1.10.14-beta.1 → 1.10.14-beta.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/context-engine.js +10 -2
- package/dist/index.js +4 -2
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/dist/context-engine.js
CHANGED
|
@@ -79,6 +79,14 @@ function normalizeCompactResult(response, options = {}) {
|
|
|
79
79
|
const tokenAccumulatorAfter = typeof response?.tokenAccumulatorAfter === "number" ? response.tokenAccumulatorAfter : undefined;
|
|
80
80
|
const totalTurns = typeof response?.totalTurns === "bigint" ? response.totalTurns : undefined;
|
|
81
81
|
const skippedNoNewTurns = typeof response?.skippedNoNewTurns === "boolean" ? response.skippedNoNewTurns : undefined;
|
|
82
|
+
// The daemon deliberately reports didCompact=false when the session has
|
|
83
|
+
// already been compacted and no new turns have arrived. That is still a
|
|
84
|
+
// successful compaction handoff for OpenClaw: the daemon-owned projection
|
|
85
|
+
// remains valid and must be activated so the host retries against it.
|
|
86
|
+
const alreadyCompacted = skippedNoNewTurns === true &&
|
|
87
|
+
lastCompactedTurn != null &&
|
|
88
|
+
lastCompactedTurn > 0n;
|
|
89
|
+
const effectiveCompacted = didCompact || alreadyCompacted;
|
|
82
90
|
if (lastCompactedTurn != null ||
|
|
83
91
|
tokenAccumulatorAfter != null ||
|
|
84
92
|
totalTurns != null ||
|
|
@@ -106,14 +114,14 @@ function normalizeCompactResult(response, options = {}) {
|
|
|
106
114
|
// instead of accepting a bloated session.
|
|
107
115
|
const threshold = options.threshold;
|
|
108
116
|
const overBudget = threshold != null && tokensBefore >= threshold;
|
|
109
|
-
const engineRefused = !
|
|
117
|
+
const engineRefused = !effectiveCompacted && overBudget;
|
|
110
118
|
const tokensAfter = didCompact && typeof response?.tokensAfter === "number" && response.tokensAfter >= 0
|
|
111
119
|
? response.tokensAfter
|
|
112
120
|
: undefined;
|
|
113
121
|
return {
|
|
114
122
|
ok: !engineRefused,
|
|
115
123
|
compacted: didCompact,
|
|
116
|
-
...(
|
|
124
|
+
...(effectiveCompacted ? {} : { reason: engineRefused ? "overbudget_not_compacted" : "not_compacted" }),
|
|
117
125
|
result: {
|
|
118
126
|
tokensBefore,
|
|
119
127
|
...(tokensAfter != null ? { tokensAfter } : {}),
|
package/dist/index.js
CHANGED
|
@@ -18903,6 +18903,8 @@ function normalizeCompactResult(response, options = {}) {
|
|
|
18903
18903
|
const tokenAccumulatorAfter = typeof response?.tokenAccumulatorAfter === "number" ? response.tokenAccumulatorAfter : void 0;
|
|
18904
18904
|
const totalTurns = typeof response?.totalTurns === "bigint" ? response.totalTurns : void 0;
|
|
18905
18905
|
const skippedNoNewTurns = typeof response?.skippedNoNewTurns === "boolean" ? response.skippedNoNewTurns : void 0;
|
|
18906
|
+
const alreadyCompacted = skippedNoNewTurns === true && lastCompactedTurn != null && lastCompactedTurn > 0n;
|
|
18907
|
+
const effectiveCompacted = didCompact || alreadyCompacted;
|
|
18906
18908
|
if (lastCompactedTurn != null || tokenAccumulatorAfter != null || totalTurns != null || skippedNoNewTurns != null) {
|
|
18907
18909
|
options.logger?.info?.(
|
|
18908
18910
|
`[compact:trace] daemon state lastCompactedTurn=${lastCompactedTurn?.toString() ?? "unknown"} tokenAccumulatorAfter=${tokenAccumulatorAfter ?? "unknown"} totalTurns=${totalTurns?.toString() ?? "unknown"} skippedNoNewTurns=${skippedNoNewTurns ?? "unknown"}`
|
|
@@ -18922,12 +18924,12 @@ function normalizeCompactResult(response, options = {}) {
|
|
|
18922
18924
|
};
|
|
18923
18925
|
const threshold = options.threshold;
|
|
18924
18926
|
const overBudget = threshold != null && tokensBefore >= threshold;
|
|
18925
|
-
const engineRefused = !
|
|
18927
|
+
const engineRefused = !effectiveCompacted && overBudget;
|
|
18926
18928
|
const tokensAfter = didCompact && typeof response?.tokensAfter === "number" && response.tokensAfter >= 0 ? response.tokensAfter : void 0;
|
|
18927
18929
|
return {
|
|
18928
18930
|
ok: !engineRefused,
|
|
18929
18931
|
compacted: didCompact,
|
|
18930
|
-
...
|
|
18932
|
+
...effectiveCompacted ? {} : { reason: engineRefused ? "overbudget_not_compacted" : "not_compacted" },
|
|
18931
18933
|
result: {
|
|
18932
18934
|
tokensBefore,
|
|
18933
18935
|
...tokensAfter != null ? { tokensAfter } : {},
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "libravdb-memory",
|
|
3
3
|
"name": "LibraVDB Memory",
|
|
4
4
|
"description": "Cognitive memory engine — causal graph reasoning, predictive context, identity tracking, and hybrid vector recall with back-door adjustment scoring",
|
|
5
|
-
"version": "1.10.14-beta.
|
|
5
|
+
"version": "1.10.14-beta.2",
|
|
6
6
|
"kind": [
|
|
7
7
|
"memory",
|
|
8
8
|
"context-engine"
|