openclaw-memory-alibaba-local 1.0.8 → 1.0.9
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/index.ts +8 -8
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -1343,7 +1343,7 @@ async function captureUserMemoryFromInboundTexts(
|
|
|
1343
1343
|
if (action.action === "delete") {
|
|
1344
1344
|
const hit = existingCandidates.find((c) => c.entry.id === action.memoryId);
|
|
1345
1345
|
if (hit) {
|
|
1346
|
-
await deleteSimilarLogicalMemory(db, agentId,
|
|
1346
|
+
await deleteSimilarLogicalMemory(db, agentId, hit.entry.sessionId, hit);
|
|
1347
1347
|
}
|
|
1348
1348
|
continue;
|
|
1349
1349
|
}
|
|
@@ -1351,7 +1351,7 @@ async function captureUserMemoryFromInboundTexts(
|
|
|
1351
1351
|
if (action.action === "update") {
|
|
1352
1352
|
const hit = existingCandidates.find((c) => c.entry.id === action.memoryId);
|
|
1353
1353
|
if (hit) {
|
|
1354
|
-
await deleteSimilarLogicalMemory(db, agentId,
|
|
1354
|
+
await deleteSimilarLogicalMemory(db, agentId, hit.entry.sessionId, hit);
|
|
1355
1355
|
}
|
|
1356
1356
|
const { vectors } = await backend.encodeForStorage(action.text);
|
|
1357
1357
|
const rows = buildChunkRows(
|
|
@@ -1447,7 +1447,7 @@ async function captureUserMemoryFromInboundTexts(
|
|
|
1447
1447
|
if (action.action === "delete") {
|
|
1448
1448
|
const hit = existingCandidates.find((c) => c.entry.id === action.memoryId);
|
|
1449
1449
|
if (hit) {
|
|
1450
|
-
await deleteSimilarLogicalMemory(db, agentId,
|
|
1450
|
+
await deleteSimilarLogicalMemory(db, agentId, hit.entry.sessionId, hit);
|
|
1451
1451
|
}
|
|
1452
1452
|
continue;
|
|
1453
1453
|
}
|
|
@@ -1455,7 +1455,7 @@ async function captureUserMemoryFromInboundTexts(
|
|
|
1455
1455
|
if (action.action === "update") {
|
|
1456
1456
|
const hit = existingCandidates.find((c) => c.entry.id === action.memoryId);
|
|
1457
1457
|
if (hit) {
|
|
1458
|
-
await deleteSimilarLogicalMemory(db, agentId,
|
|
1458
|
+
await deleteSimilarLogicalMemory(db, agentId, hit.entry.sessionId, hit);
|
|
1459
1459
|
}
|
|
1460
1460
|
const { vectors } = await backend.encodeForStorage(action.text);
|
|
1461
1461
|
const rows = buildChunkRows(
|
|
@@ -1600,10 +1600,10 @@ async function deleteSimilarLogicalMemory(
|
|
|
1600
1600
|
sessionId: string | null | undefined,
|
|
1601
1601
|
hit: MemorySearchResult,
|
|
1602
1602
|
): Promise<void> {
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
}
|
|
1603
|
+
// Try text-match delete first (covers all chunks), then ID-based fallback.
|
|
1604
|
+
// deleteByAgentSessionCategoryText returns optimistic 1, so always also try by ID.
|
|
1605
|
+
await db.deleteByAgentSessionCategoryText(agentId, sessionId, hit.entry.category, hit.entry.text);
|
|
1606
|
+
await db.delete(agentId, hit.entry.id).catch(() => {});
|
|
1607
1607
|
}
|
|
1608
1608
|
|
|
1609
1609
|
async function storeOneCaptureItem(
|