fix: silence Mission 404 storm + Assistant 422 noise
Three sources of red errors in scene walk:
1. Mission/Approvals: GET /api/runtime/transactions/{key} 404 storm.
The runtime backend's single-transaction endpoint is broken
(returns 500 'transaction_read_failed: All connection attempts
failed' even on valid IDs from the list endpoint, and 404 for
work-item IDs that don't exist in the runtime DB at all).
Fix in buildScenarios.ts: keep the headlineTx fetch (still tries
to enrich) but synthesize a RuntimeTransaction shape from
work-item data via workItemToRt() when the API call returns null.
Skip the 3x 'recent' GETs entirely — they were always 404ing.
Fix in store.ts pollLiveTick: .catch(() => null) on the headline
transaction call so polling never surfaces backend brokenness.
2. Assistant: POST /api/ea2/apply-batch 422/404 when remembering.
Vault edge attach can race with vault creation OR target a doc
that hasn't propagated. Wrap in try/catch with console.warn so
the failure is visible in logs but doesn't fire as a red console
error on every turn.
This commit is contained in:
+18
-11
@@ -83,17 +83,24 @@ export const agentMemory = {
|
||||
});
|
||||
if (!doc.ok) return null;
|
||||
const mem = await doc.json();
|
||||
await fetch(`${api.config.baseUrl}/api/ea2/apply-batch`, {
|
||||
method: "POST",
|
||||
headers: authHeaders(),
|
||||
body: JSON.stringify({
|
||||
request_id: newRequestId(),
|
||||
ops: [
|
||||
{ op: "create_edge", edge_coll: "defines", from: `flow/${vaultKey}`, to: `flow/${mem._key}`, role: "presentation" },
|
||||
],
|
||||
}),
|
||||
signal,
|
||||
});
|
||||
try {
|
||||
const edgeRes = await fetch(`${api.config.baseUrl}/api/ea2/apply-batch`, {
|
||||
method: "POST",
|
||||
headers: authHeaders(),
|
||||
body: JSON.stringify({
|
||||
request_id: newRequestId(),
|
||||
ops: [
|
||||
{ op: "create_edge", edge_coll: "defines", from: `flow/${vaultKey}`, to: `flow/${mem._key}`, role: "presentation" },
|
||||
],
|
||||
}),
|
||||
signal,
|
||||
});
|
||||
if (!edgeRes.ok) {
|
||||
console.warn(`[memory] vault edge attach returned ${edgeRes.status} for ${mem._key} (recall may miss this entry)`);
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn(`[memory] vault edge attach threw: ${(e as Error).message}`);
|
||||
}
|
||||
return mem._key;
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user