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: watchdog probes used a sql.query form the db proxy never had

nirholas1bf31dcad2c7
diff --git a/api/_lib/financial-tripwire.js b/api/_lib/financial-tripwire.js
index bdcac9dcb..376090a81 100644
--- a/api/_lib/financial-tripwire.js
+++ b/api/_lib/financial-tripwire.js
@@ -83,7 +83,7 @@ async function upsertTripwireVerdict({ subsystem, reconciled, runId, detail }) {
export async function lastActivityMs(table, tsColumn = 'created_at') {
try {
// table/column are internal literals, never user input.
- const rows = await sql.query(`SELECT extract(epoch from max(${tsColumn})) * 1000 AS ms FROM ${table}`);
+ const rows = await sql(`SELECT extract(epoch from max(${tsColumn})) * 1000 AS ms FROM ${table}`);
const ms = rows?.[0]?.ms;
return ms != null ? Number(ms) : null;
} catch {
diff --git a/api/cron/sniper-loops-health.js b/api/cron/sniper-loops-health.js
index a0f780d39..c7909ca12 100644
--- a/api/cron/sniper-loops-health.js
+++ b/api/cron/sniper-loops-health.js
@@ -38,7 +38,7 @@ async function probeLoop(loop) {
try {
const where = loop.networkColumn ? `where ${loop.networkColumn} = $1` : '';
const params = loop.networkColumn ? [NETWORK] : [];
- const rows = await sql.query(
+ const rows = await sql(
`select max(${loop.column}) as last_at from ${loop.table} ${where}`,
params,
);
diff --git a/api/ops/money-health.js b/api/ops/money-health.js
index 087859b40..114d75b8e 100644
--- a/api/ops/money-health.js
+++ b/api/ops/money-health.js
@@ -35,7 +35,7 @@ const SUBSYSTEMS = [
async function lastActivity(table, ts) {
if (!table) return null;
try {
- const rows = await sql.query(`SELECT extract(epoch from max(${ts})) * 1000 AS ms FROM ${table}`);
+ const rows = await sql(`SELECT extract(epoch from max(${ts})) * 1000 AS ms FROM ${table}`);
return rows?.[0]?.ms != null ? Number(rows[0].ms) : null;
} catch { return null; }
}