@xdarkicex/openclaw-memory-libravdb 1.4.51 → 1.4.52
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 +5 -2
- package/dist/index.js +5 -2
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/dist/context-engine.js
CHANGED
|
@@ -353,18 +353,21 @@ export function normalizeAssembleResult(result) {
|
|
|
353
353
|
}
|
|
354
354
|
export function buildContextEngineFactory(runtime, cfg, logger = console) {
|
|
355
355
|
let cachedIdentity = null;
|
|
356
|
+
let cachedSessionKey;
|
|
356
357
|
function resolveUserId(args) {
|
|
357
358
|
// Framework-provided userId takes priority (channels, future SDK compat).
|
|
358
359
|
const fwUserId = args?.userIdOverride?.trim();
|
|
359
360
|
if (fwUserId)
|
|
360
361
|
return fwUserId;
|
|
361
|
-
|
|
362
|
+
const sessionKey = args?.sessionKey?.trim() || undefined;
|
|
363
|
+
if (!cachedIdentity || cachedSessionKey !== sessionKey) {
|
|
362
364
|
cachedIdentity = resolveIdentity({
|
|
363
365
|
configUserId: cfg.userId,
|
|
364
366
|
identityPath: cfg.identityPath,
|
|
365
|
-
sessionKey
|
|
367
|
+
sessionKey,
|
|
366
368
|
logger,
|
|
367
369
|
});
|
|
370
|
+
cachedSessionKey = sessionKey;
|
|
368
371
|
}
|
|
369
372
|
return cachedIdentity.userId;
|
|
370
373
|
}
|
package/dist/index.js
CHANGED
|
@@ -33931,16 +33931,19 @@ function normalizeAssembleResult(result) {
|
|
|
33931
33931
|
}
|
|
33932
33932
|
function buildContextEngineFactory(runtime, cfg, logger = console) {
|
|
33933
33933
|
let cachedIdentity = null;
|
|
33934
|
+
let cachedSessionKey;
|
|
33934
33935
|
function resolveUserId(args) {
|
|
33935
33936
|
const fwUserId = args?.userIdOverride?.trim();
|
|
33936
33937
|
if (fwUserId) return fwUserId;
|
|
33937
|
-
|
|
33938
|
+
const sessionKey = args?.sessionKey?.trim() || void 0;
|
|
33939
|
+
if (!cachedIdentity || cachedSessionKey !== sessionKey) {
|
|
33938
33940
|
cachedIdentity = resolveIdentity({
|
|
33939
33941
|
configUserId: cfg.userId,
|
|
33940
33942
|
identityPath: cfg.identityPath,
|
|
33941
|
-
sessionKey
|
|
33943
|
+
sessionKey,
|
|
33942
33944
|
logger
|
|
33943
33945
|
});
|
|
33946
|
+
cachedSessionKey = sessionKey;
|
|
33944
33947
|
}
|
|
33945
33948
|
return cachedIdentity.userId;
|
|
33946
33949
|
}
|
package/openclaw.plugin.json
CHANGED