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.
Files changed (2) hide show
  1. package/index.ts +18 -17
  2. 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
- sessionId: string | null | undefined,
1600
+ _sessionId: string | null | undefined,
1601
1601
  hit: MemorySearchResult,
1602
1602
  ): Promise<void> {
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(() => {});
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 the last user message for known bootstrap patterns.
2178
+ // Check ANY user message for known bootstrap patterns (not just last).
2181
2179
  if (isUserTrigger) {
2182
- const lastUserMsg = [...event.messages].reverse().find(
2183
- (m: any) => m && typeof m === "object" && (m as Record<string, unknown>).role === "user",
2184
- ) as Record<string, unknown> | undefined;
2185
- const lastUserText = typeof lastUserMsg?.content === "string" ? lastUserMsg.content.toLowerCase() : "";
2186
- if (
2187
- lastUserText.includes("a new session was started") ||
2188
- lastUserText.includes("session startup sequence") ||
2189
- lastUserText.includes("/new or /reset") ||
2190
- lastUserText.startsWith("system:") ||
2191
- lastUserText.startsWith("run your session")
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclaw-memory-alibaba-local",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "OpenClaw memory plugin: local LanceDB + DashScope-compatible embeddings",
5
5
  "type": "module",
6
6
  "engines": {