fix(memory): use edge role=memory not presentation
EA2 enforces one-defines-presentation-per-node — only the first memory could ever attach because every subsequent create_edge(role=presentation) from the vault returned 500 [ERR 1650]. Use role=memory for ongoing memories. listAll filter accepts both for back-compat with the single existing presentation edge.
This commit is contained in:
@@ -94,7 +94,7 @@ export const agentMemory = {
|
|||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
request_id: newRequestId(),
|
request_id: newRequestId(),
|
||||||
ops: [
|
ops: [
|
||||||
{ op: "create_edge", edge_coll: "defines", from: `flow/${vaultKey}`, to: `flow/${mem._key}`, role: "presentation" },
|
{ op: "create_edge", edge_coll: "defines", from: `flow/${vaultKey}`, to: `flow/${mem._key}`, role: "memory" },
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
signal,
|
signal,
|
||||||
@@ -116,7 +116,7 @@ export const agentMemory = {
|
|||||||
if (!edgesRes.ok) return [];
|
if (!edgesRes.ok) return [];
|
||||||
const edges = (await edgesRes.json())?.items || [];
|
const edges = (await edgesRes.json())?.items || [];
|
||||||
const memKeys = (edges as any[])
|
const memKeys = (edges as any[])
|
||||||
.filter((e) => e?.role === "presentation")
|
.filter((e) => e?.role === "memory" || e?.role === "presentation")
|
||||||
.map((e) => (e._to || "").split("/").pop())
|
.map((e) => (e._to || "").split("/").pop())
|
||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
.slice(0, cap) as string[];
|
.slice(0, cap) as string[];
|
||||||
|
|||||||
Reference in New Issue
Block a user