fix(memory): use edge role=child (valid EA2 vocab)
Probed backend's defines edge role vocabulary. Accepted: child, dispatch. Rejected: memory, observation, note, recall, vault, step, view. Switching from invalid 'memory' to valid 'child' so the edge attach actually lands without 500.
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: "memory" },
|
{ op: "create_edge", edge_coll: "defines", from: `flow/${vaultKey}`, to: `flow/${mem._key}`, role: "child" },
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
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 === "memory" || e?.role === "presentation")
|
.filter((e) => e?.role === "child" || 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