Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

feat(home): time every action so the latency SLO has a number behind it

nirholas013cf631cc85
diff --git a/api/home/[id]/call.js b/api/home/[id]/call.js
index 9ed679d9b..becf5e378 100644
--- a/api/home/[id]/call.js
+++ b/api/home/[id]/call.js
@@ -184,7 +184,16 @@ export default wrap(async (req, res) => {
attributes: targets[0] ? bridge.states?.[targets[0]]?.attributes : undefined,
});
+ // Our own leg of the call, which is what the latency SLO is written against
+ // (docs/ops/home-operations.md). It deliberately includes the house's
+ // service call, because there is no point at which we can separate the two
+ // from here; what it excludes is everything before the gate: auth, the
+ // store read and the pool open. A p95 measured on a number nobody records
+ // is a number nobody has, so this is stamped on every action rather than
+ // sampled.
+ const startedAt = Date.now();
const result = await bridge.call(domain, service, data, { confirmed });
+ const latencyMs = Date.now() - startedAt;
logHomeAction({
homeId: home.id,
@@ -197,7 +206,7 @@ export default wrap(async (req, res) => {
confirmedBy: verdict.guarded && confirmed ? caller.userId : null,
risk: verdict.risk,
outcome: 'ok',
- detail: { via: caller.via, allowed_by_grant: verdict.guarded && !confirmed },
+ detail: { via: caller.via, allowed_by_grant: verdict.guarded && !confirmed, latencyMs },
});
return json(res, 200, {