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(npc,ops): stop citizens quoting onboarding boilerplate, fix the LLM failover probe's payload shape

nirholasd11a3824fc04
diff --git a/scripts/event-dependency-failover.mjs b/scripts/event-dependency-failover.mjs
index 843dd5182..600664745 100644
--- a/scripts/event-dependency-failover.mjs
+++ b/scripts/event-dependency-failover.mjs
@@ -213,22 +213,32 @@ async function checkLlm(base) {
// The platform already ships a real probe of its own routing chain; asking the
// live deployment is more truthful than re-deriving the chain here, because it
// answers with the keys production actually holds, not the ones in this shell.
+ // The endpoint is cron-secret gated on purpose: its error strings name which
+ // provider key is bad and can carry quota detail. Present the same secret an
+ // operator or external monitor would.
+ const secret = process.env.CRON_SECRET || '';
const r = await timed(async () => {
- const res = await fetch(`${base}/api/llm/health`, { signal: AbortSignal.timeout(45_000) });
- if (!res.ok) throw new Error(`http ${res.status}`);
+ const res = await fetch(`${base}/api/llm/health`, {
+ headers: secret ? { 'x-cron-secret': secret } : {},
+ signal: AbortSignal.timeout(60_000),
+ });
+ if (!res.ok) throw new Error(`http ${res.status}${res.status === 403 ? ' (set CRON_SECRET to probe this)' : ''}`);
return await res.json();
});
if (!r.ok) {
record('llm', { what: 'NPC citizens, concierge, in-world chat', rungsTotal: 0, rungsLive: 0, rungs: [], failoverProven: false, failoverDetail: r.error, pass: false });
return;
}
- const providers = r.value?.providers || r.value?.results || [];
- const rungs = (Array.isArray(providers) ? providers : Object.entries(providers).map(([k, v]) => ({ name: k, ...v }))).map((p) => ({
- rung: p.name || p.provider || 'unknown',
- ok: p.ok === true || p.status === 'ok' || p.status === 'healthy',
- ms: p.ms ?? null,
- error: p.error || (p.status && p.status !== 'ok' ? p.status : null),
- }));
+ // The payload is keyed by provider with a sibling `overall` verdict, so read
+ // every entry that carries a status rather than assuming a `providers` array.
+ const rungs = Object.entries(r.value || {})
+ .filter(([key, v]) => key !== 'overall' && v && typeof v === 'object' && 'status' in v)
+ .map(([key, v]) => ({
+ rung: key,
+ ok: v.status === 'ok' || v.status === 'healthy',
+ ms: v.ms ?? null,
+ error: v.error || (v.status !== 'ok' ? v.status : null),
+ }));
const live = rungs.filter((x) => x.ok);
record('llm', {
what: 'NPC citizens, concierge, in-world chat',
diff --git a/src/game/npc/citizens.js b/src/game/npc/citizens.js
index a94349aa0..ed26a04e8 100644
--- a/src/game/npc/citizens.js
+++ b/src/game/npc/citizens.js
@@ -109,6 +109,13 @@ function looksAnonymous(name) {
return false;
}
+// The stock descriptions the onboarding and generation lanes write for a profile
+// nobody has edited yet. They address the owner ("Edit the personality…"), not a
+// visitor, so they describe no character and never reach a citizen's voice.
+function isBoilerplateBio(text) {
+ return /^(a friendly starter agent|operated by a three\.ws agent|edit the personality)/i.test(String(text).trim());
+}
+
// A record is a citizen (someone you can meet) when it carries a name that
// actually identifies somebody. Nameless and placeholder-named gallery models
// stay honest anonymous scenery: they still walk the plaza, but with no
@@ -191,7 +198,17 @@ export async function talkToCitizen(citizen, { world, ui } = {}) {
const parts = [];
if (agent) {
parts.push(`You are a registered three.ws agent, out for a stroll through the town plaza. You genuinely live on this platform: you have a public profile, an on-chain wallet, and a reputation you have earned.`);
- if (agent.description) parts.push(`Your public profile describes you like this: "${agent.description}". Speak as that person.`);
+ // An agent still wearing its onboarding defaults carries setup copy, not a
+ // character ("A friendly starter agent. Edit the personality…"). Feeding
+ // that in makes the citizen introduce itself as an unfinished form. Its
+ // wallet, skills and creator are still real, so only the boilerplate
+ // description is dropped; the avatar's own gallery identity carries the voice.
+ const configured = agent.name && !looksAnonymous(agent.name);
+ if (configured && agent.description && !isBoilerplateBio(agent.description)) {
+ parts.push(`Your public profile describes you like this: "${agent.description}". Speak as that person.`);
+ } else if (rec.description && !isBoilerplateBio(rec.description)) {
+ parts.push(`Your look, as the gallery describes it: "${rec.description}". Let that shape your personality.`);
+ }
const skills = (Array.isArray(agent.skills) ? agent.skills : [])
.map((s) => (typeof s === 'string' ? s : s?.name))
.filter(Boolean)