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.

Fix oracle activity 500 from destructuring a single aggregate row

nirholas8f7e9a5bd6db
diff --git a/api/oracle/activity.js b/api/oracle/activity.js
index 29508dba7..13e6b843b 100644
--- a/api/oracle/activity.js
+++ b/api/oracle/activity.js
@@ -94,8 +94,11 @@ export default wrap(async (req, res) => {
const items = rows.map(shapeRow);
- // Summary counts for the header KPIs
- const [summary] = await sql`
+ // Summary counts for the header KPIs. `.then(r => r[0])` already unwraps the
+ // single aggregate row, so assign it directly — array-destructuring a plain
+ // row object (or the null/undefined the catch/empty-result yields) throws
+ // "(intermediate value) is not iterable" and 500s the endpoint.
+ const summary = await sql`
select
count(*) as total,
count(*) filter (where mode = 'live') as live_count,