openclaw-memory-alibaba-local 1.0.9 → 1.0.10
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 +18 -17
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -1597,13 +1597,11 @@ function buildChunkRows(
|
|
|
1597
1597
|
async function deleteSimilarLogicalMemory(
|
|
1598
1598
|
db: MemoryDB,
|
|
1599
1599
|
agentId: string,
|
|
1600
|
-
|
|
1600
|
+
_sessionId: string | null | undefined,
|
|
1601
1601
|
hit: MemorySearchResult,
|
|
1602
1602
|
): Promise<void> {
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
await db.deleteByAgentSessionCategoryText(agentId, sessionId, hit.entry.category, hit.entry.text);
|
|
1606
|
-
await db.delete(agentId, hit.entry.id).catch(() => {});
|
|
1603
|
+
console.log(`[openclaw-memory-alibaba-local] deleteSimilarLogicalMemory id=${hit.entry.id} agentId=${agentId} text=${hit.entry.text.slice(0, 60)}`);
|
|
1604
|
+
await db.delete(agentId, hit.entry.id);
|
|
1607
1605
|
}
|
|
1608
1606
|
|
|
1609
1607
|
async function storeOneCaptureItem(
|
|
@@ -2177,19 +2175,22 @@ const memoryPlugin = {
|
|
|
2177
2175
|
const isUserTrigger = trigger === "user";
|
|
2178
2176
|
|
|
2179
2177
|
// Skip memory extraction for system/bootstrap sessions (/new, /reset).
|
|
2180
|
-
// Check
|
|
2178
|
+
// Check ANY user message for known bootstrap patterns (not just last).
|
|
2181
2179
|
if (isUserTrigger) {
|
|
2182
|
-
const
|
|
2183
|
-
(m
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2180
|
+
const isBootstrapSession = event.messages.some((m: any) => {
|
|
2181
|
+
if (!m || typeof m !== "object" || (m as Record<string, unknown>).role !== "user") return false;
|
|
2182
|
+
const text = typeof (m as Record<string, unknown>).content === "string"
|
|
2183
|
+
? ((m as Record<string, unknown>).content as string).toLowerCase()
|
|
2184
|
+
: "";
|
|
2185
|
+
return (
|
|
2186
|
+
text.includes("a new session was started") ||
|
|
2187
|
+
text.includes("session startup sequence") ||
|
|
2188
|
+
text.includes("/new or /reset") ||
|
|
2189
|
+
text.startsWith("system:") ||
|
|
2190
|
+
text.startsWith("run your session")
|
|
2191
|
+
);
|
|
2192
|
+
});
|
|
2193
|
+
if (isBootstrapSession) {
|
|
2193
2194
|
console.log("[openclaw-memory-alibaba-local] agent_end skip capture (system/bootstrap session)");
|
|
2194
2195
|
return;
|
|
2195
2196
|
}
|