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 test suite: CSRF order, branding allowlist, text-to-image prompt

nirholasfeab80045b6a
diff --git a/api/agents.js b/api/agents.js
index 89a0ba588..6d91b3d6f 100644
--- a/api/agents.js
+++ b/api/agents.js
@@ -483,6 +483,11 @@ export async function handleWallet(req, res, id, action = null) {
const auth = await resolveAuth(req);
if (!auth) return error(res, 401, 'unauthorized', 'sign in required');
+ // CSRF check before any DB lookups for state-mutating methods.
+ if (req.method !== 'GET') {
+ if (!(await requireCsrf(req, res, auth.userId))) return;
+ }
+
const [existing] = await sql`
SELECT id, user_id, wallet_address, chain_id, meta FROM agent_identities WHERE id = ${id} AND deleted_at IS NULL
`;
@@ -521,8 +526,6 @@ export async function handleWallet(req, res, id, action = null) {
});
}
- if (!(await requireCsrf(req, res, auth.userId))) return;
-
// POST /api/agents/:id/wallet/provision — idempotently generate the agent's
// custodial EVM + Solana wallets. This is the "Create wallet" action surfaced
// on every avatar surface; safe to call repeatedly (returns existing addresses).
diff --git a/public/demos-embed/selfie.html b/public/demos-embed/selfie.html
index 739961a0f..c9290d156 100644
--- a/public/demos-embed/selfie.html
+++ b/public/demos-embed/selfie.html
@@ -77,7 +77,7 @@
</div>
<div class="av-cell">
<agent-3d src="https://three.ws/avatars/readyplayerme.glb"></agent-3d>
- <div class="av-label">Ready Player Me</div>
+ <div class="av-label">Sample Avatar</div>
</div>
<div class="av-cell">
<agent-3d src="https://three.ws/avatars/michelle.glb"></agent-3d>
diff --git a/tests/api/text-to-image.test.js b/tests/api/text-to-image.test.js
index 6393ebbf9..5ec78f9ef 100644
--- a/tests/api/text-to-image.test.js
+++ b/tests/api/text-to-image.test.js
@@ -114,7 +114,8 @@ describe('textToImage — NIM FLUX free lane (first)', () => {
expect(vertexState.generate).not.toHaveBeenCalled();
expect(calls).toHaveLength(1);
expect(calls[0].url).toContain('flux.1-schnell');
- expect(calls[0].body).toMatchObject({ prompt: 'a red teapot', steps: 4 });
+ expect(calls[0].body.prompt).toMatch(/^a red teapot/);
+ expect(calls[0].body).toMatchObject({ steps: 4 });
// schnell is guidance-distilled: the endpoint 422s on cfg_scale > 0
// (verified live), so the request must not send it at all.
expect(calls[0].body).not.toHaveProperty('cfg_scale');
diff --git a/tests/branding-allowlist.json b/tests/branding-allowlist.json
index 0fdaba997..5d6ec2d8f 100644
--- a/tests/branding-allowlist.json
+++ b/tests/branding-allowlist.json
@@ -353,5 +353,25 @@
"pattern": "RPM",
"file": "pages/create.html",
"reason": "Same single-line RPM importer entry point on /create — the abbreviation appears in the link text."
+ },
+ {
+ "pattern": "Avaturn",
+ "file": "docs/internal/ISSUES-ARCHIVE-2026-05.md",
+ "reason": "Closed-issue archive — historical record of a rejected Avaturn integration (status: NOT USING / CLOSED); not surfaced in any live product UI."
+ },
+ {
+ "pattern": "avaturn-api-key",
+ "file": "docs/internal/ISSUES-ARCHIVE-2026-05.md",
+ "reason": "Closed-issue archive — references the internal remediation-guide filename (fix-avaturn-api-key.md); not user-facing copy."
+ },
+ {
+ "pattern": "character-studio/eslint.config.mjs",
+ "file": "docs/internal/ISSUES-ARCHIVE-2026-05.md",
+ "reason": "Closed-issue archive — technical context note about the character-studio eslint migration; not user-facing copy."
+ },
+ {
+ "pattern": "readyplayerme.glb",
+ "file": "public/demos-embed/selfie.html",
+ "reason": "Hosted GLB asset filename for a 3D avatar in the embed demo — the asset name is a legacy identifier, not visible UI copy."
}
]