mr-memory 2.11.3 → 2.11.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/upload.ts +11 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mr-memory",
3
- "version": "2.11.3",
3
+ "version": "2.11.4",
4
4
  "description": "MemoryRouter persistent memory plugin for OpenClaw — your AI remembers every conversation",
5
5
  "type": "module",
6
6
  "files": [
package/upload.ts CHANGED
@@ -123,7 +123,17 @@ async function sessionToJsonl(filePath: string): Promise<MemoryLine[]> {
123
123
  timestamp = Date.now();
124
124
  }
125
125
 
126
- lines.push({ content: text.trim(), role: msg.role, timestamp });
126
+ const trimmedText = text.trim();
127
+
128
+ // Chunk oversized messages to avoid blowing up the embedding service
129
+ if (trimmedText.length > MAX_ITEM_CHARS) {
130
+ const chunks = chunkText(trimmedText, TARGET_CHUNK_CHARS);
131
+ for (const chunk of chunks) {
132
+ lines.push({ content: chunk, role: msg.role, timestamp });
133
+ }
134
+ } else {
135
+ lines.push({ content: trimmedText, role: msg.role, timestamp });
136
+ }
127
137
  } catch {
128
138
  // Skip invalid lines
129
139
  }