memorylake-openclaw 1.0.2-beta.2 → 1.0.2-beta.4
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 +19 -2
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Features:
|
|
7
7
|
* - 9 tools: memory_search, memory_list, memory_store, memory_get, memory_forget, document_search, document_download, advanced_web_search, open_data_search
|
|
8
|
-
* - Auto-recall: injects
|
|
8
|
+
* - Auto-recall: injects memory-search instructions (+ open-data categories) into the system prompt before each agent turn
|
|
9
9
|
* - Auto-capture: stores key facts scoped to the current session after each agent turn
|
|
10
10
|
* - CLI: openclaw memorylake search, openclaw memorylake stats
|
|
11
11
|
*/
|
|
@@ -994,6 +994,23 @@ const memoryPlugin = {
|
|
|
994
994
|
content: r.content,
|
|
995
995
|
created_at: r.created_at,
|
|
996
996
|
}));
|
|
997
|
+
|
|
998
|
+
// Check for unresolved conflicts among returned memories
|
|
999
|
+
const conflictMemoryIds = results
|
|
1000
|
+
.filter((r) => r.has_unresolved_conflict)
|
|
1001
|
+
.map((r) => r.id);
|
|
1002
|
+
if (conflictMemoryIds.length > 0) {
|
|
1003
|
+
try {
|
|
1004
|
+
const effectiveUserId = userId ?? effectiveCfg.userId;
|
|
1005
|
+
const conflicts = await effectiveProvider.listConflicts(conflictMemoryIds, effectiveUserId);
|
|
1006
|
+
if (conflicts.length > 0) {
|
|
1007
|
+
const conflictText = buildConflictContext(conflicts);
|
|
1008
|
+
sections.push(`## Memory Conflicts\nThe following memories have unresolved conflicts. Review and help the user resolve them if relevant:\n\n${conflictText}`);
|
|
1009
|
+
}
|
|
1010
|
+
} catch (err) {
|
|
1011
|
+
sections.push(`## Memory Conflicts\nFailed to fetch conflicts: ${String(err)}`);
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
997
1014
|
} else if (memoryResult.status === "rejected") {
|
|
998
1015
|
sections.push(`## Memories\nMemory search failed: ${String(memoryResult.reason)}`);
|
|
999
1016
|
}
|
|
@@ -1011,7 +1028,7 @@ const memoryPlugin = {
|
|
|
1011
1028
|
content: [
|
|
1012
1029
|
{ type: "text", text: "No relevant memories or documents found." },
|
|
1013
1030
|
],
|
|
1014
|
-
details: {
|
|
1031
|
+
details: { memoryCount: 0, documentCount: 0, memories: [] },
|
|
1015
1032
|
};
|
|
1016
1033
|
}
|
|
1017
1034
|
|