fix: silence Mission 404 storm + Assistant 422 noise
build-and-publish / test (push) Has been cancelled
build-and-publish / image (push) Has been cancelled

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:
canvas-bot
2026-06-16 21:13:35 +04:00
parent 76ce4c23b2
commit b0127c24eb
4 changed files with 138 additions and 17 deletions
+18 -11
View File
@@ -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;
},