mr-memory 2.3.1 → 2.5.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 +8 -3
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -195,6 +195,7 @@ const memoryRouterPlugin = {
|
|
|
195
195
|
},
|
|
196
196
|
body: JSON.stringify({
|
|
197
197
|
messages: contextPayload,
|
|
198
|
+
session_id: ctx.sessionKey,
|
|
198
199
|
density,
|
|
199
200
|
|
|
200
201
|
}),
|
|
@@ -290,6 +291,7 @@ const memoryRouterPlugin = {
|
|
|
290
291
|
},
|
|
291
292
|
body: JSON.stringify({
|
|
292
293
|
messages: contextPayload,
|
|
294
|
+
session_id: ctx.sessionKey,
|
|
293
295
|
density,
|
|
294
296
|
|
|
295
297
|
}),
|
|
@@ -376,8 +378,8 @@ const memoryRouterPlugin = {
|
|
|
376
378
|
|
|
377
379
|
if (toStore.length === 0) return;
|
|
378
380
|
|
|
379
|
-
// Fire
|
|
380
|
-
fetch(`${endpoint}/v1/memory/ingest`, {
|
|
381
|
+
// Fire-and-forget: don't block agent completion on memory ingestion.
|
|
382
|
+
void fetch(`${endpoint}/v1/memory/ingest`, {
|
|
381
383
|
method: "POST",
|
|
382
384
|
headers: {
|
|
383
385
|
"Content-Type": "application/json",
|
|
@@ -386,10 +388,13 @@ const memoryRouterPlugin = {
|
|
|
386
388
|
body: JSON.stringify({
|
|
387
389
|
messages: toStore,
|
|
388
390
|
session_id: ctx.sessionKey,
|
|
391
|
+
model: "unknown",
|
|
389
392
|
}),
|
|
390
393
|
}).then(async (res) => {
|
|
391
394
|
if (!res.ok) {
|
|
392
|
-
|
|
395
|
+
const details = await res.text().catch(() => "");
|
|
396
|
+
const suffix = details ? ` — ${details.slice(0, 200)}` : "";
|
|
397
|
+
api.logger.warn?.(`memoryrouter: ingest failed (${res.status})${suffix}`);
|
|
393
398
|
}
|
|
394
399
|
}).catch((err) => {
|
|
395
400
|
api.logger.warn?.(
|