mr-memory 2.16.0 → 2.17.0
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 +4 -0
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -329,6 +329,8 @@ const memoryRouterPlugin = {
|
|
|
329
329
|
for (const msg of event.historyMessages) {
|
|
330
330
|
const m = msg as { role?: string; content?: unknown };
|
|
331
331
|
if (!m.role) continue;
|
|
332
|
+
// Skip tool result/use messages — contains file reads, exec output, etc.
|
|
333
|
+
if (m.role !== "user" && m.role !== "assistant" && m.role !== "system") continue;
|
|
332
334
|
let text = "";
|
|
333
335
|
if (typeof m.content === "string") text = m.content;
|
|
334
336
|
else if (Array.isArray(m.content)) {
|
|
@@ -432,6 +434,8 @@ const memoryRouterPlugin = {
|
|
|
432
434
|
for (const msg of event.messages) {
|
|
433
435
|
const m = msg as { role?: string; content?: unknown };
|
|
434
436
|
if (!m.role) continue;
|
|
437
|
+
// Skip tool result/use messages — contains file reads, exec output, etc.
|
|
438
|
+
if (m.role !== "user" && m.role !== "assistant" && m.role !== "system") continue;
|
|
435
439
|
|
|
436
440
|
let text = "";
|
|
437
441
|
if (typeof m.content === "string") {
|