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(dev): serve /avatar-studio from the platform page so dev matches production

nirholas399b0475b1ee
diff --git a/public/changelog.json b/public/changelog.json
index 6c960687a..89bf1389a 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-08-16T18:24:16.397Z",
+ "generated_at": "2026-08-16T19:24:03.580Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
diff --git a/public/features.json b/public/features.json
index 274df41d2..beb32c357 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-08-16T18:24:16.182Z",
+ "generated_at": "2026-08-16T19:24:03.533Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
diff --git a/src/agents-live.js b/src/agents-live.js
index de3f7be4c..bbde59e4c 100644
--- a/src/agents-live.js
+++ b/src/agents-live.js
@@ -1012,7 +1012,11 @@ function applyActivityEntries(state, entries) {
}
async function hydrateActivity(ids) {
- if (!ids.length || _activityInFlight) return;
+ if (!ids.length) return;
+ // A page mounted while an earlier batch was still in flight must not be
+ // dropped, or its cards wait out the whole refresh cadence with nothing to
+ // show. Ask again as soon as the floor allows; the next batch covers them.
+ if (_activityInFlight) { scheduleActivityFlush(ACTIVITY_MIN_GAP_MS); return; }
_activityInFlight = true;
_activityLastAt = Date.now();
try {
diff --git a/src/bnb.js b/src/bnb.js
index fcdefa9c9..578b53594 100644
--- a/src/bnb.js
+++ b/src/bnb.js
@@ -170,10 +170,18 @@ function cardHtml(track) {
* Probe a URL and resolve to an HTTP status, or null on network failure/timeout.
* HEAD by default (pages, docs); POST-only APIs pass OPTIONS via the track's
* *CheckMethod so the probe never triggers a 405 console error.
+ *
+ * The response body is drained even though only the status matters: an
+ * unconsumed body is still an open stream, and the 4s timeout signal stays
+ * armed after the response lands, so the browser cancels each probe a few
+ * seconds later and logs a net::ERR_ABORTED failed request per card. Reading
+ * the (empty) HEAD/OPTIONS body closes the stream and keeps the network log
+ * clean.
*/
async function probe(url, probeMethod = 'HEAD') {
try {
const res = await fetch(url, { method: probeMethod, signal: AbortSignal.timeout(4000) });
+ await res.text();
return res.status;
} catch {
return null;
@@ -216,6 +224,12 @@ function updateProgress(states) {
const el = $('bnb-progress');
if (!el) return;
const liveCount = states.filter((s) => s === 'live').length;
+ // The element ships with data-i18n so its "Checking…" placeholder is
+ // translated at first paint, but from here on this script owns the text.
+ // Without claiming ownership, the i18n catalog pass (which lands after an
+ // async /api/locale fetch) races us and reverts the finished tally back to
+ // "Checking which tracks are live…" for the rest of the page's life.
+ el.setAttribute('data-i18n-owned', '1');
el.dataset.anyLive = liveCount > 0 ? 'true' : 'false';
el.textContent =
liveCount === 0
diff --git a/vite.config.js b/vite.config.js
index b5a914001..a0d660c38 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -1110,6 +1110,8 @@ support: resolve(__dirname, 'pages/support.html'),
'/worlds/': resolve(root, 'pages/worlds.html'),
'/create/studio': resolve(root, 'pages/avatar-studio.html'),
'/create/studio/': resolve(root, 'pages/avatar-studio.html'),
+ '/avatar-studio': resolve(root, 'pages/avatar-studio.html'),
+ '/avatar-studio/': resolve(root, 'pages/avatar-studio.html'),
'/create-review': resolve(root, 'pages/create-review.html'),
'/create-review/': resolve(root, 'pages/create-review.html'),
'/import/rpm': resolve(root, 'pages/import-rpm.html'),
@@ -2090,22 +2092,15 @@ support: resolve(__dirname, 'pages/support.html'),
req.url = '/src/i18n.js';
return next();
}
- // Avatar Studio (rebranded Character Studio fork) — serve the
- // production build out of character-studio/build/ at /avatar-studio/*
- // so the demo iframe works in dev. Run `npm run build --prefix
- // character-studio` first to populate the build dir.
- if (path === '/avatar-studio' || path === '/avatar-studio/') {
- const indexPath = resolve(root, 'character-studio/build/index.html');
- if (existsSync(indexPath)) {
- res.setHeader('Content-Type', 'text/html; charset=utf-8');
- return createReadStream(indexPath).pipe(res);
- }
- res.statusCode = 503;
- return res.end(
- 'Avatar Studio build missing — run `npm run build --prefix character-studio`',
- );
- }
- if (path.startsWith('/avatar-studio/')) {
+ // Character Studio fork: serve its production build out of
+ // character-studio/build/ at /avatar-studio/<file> so the SDK demo
+ // iframe (which addresses /avatar-studio/index.html) works in dev.
+ // Run `npm run build --prefix character-studio` first to populate
+ // the build dir. The BARE /avatar-studio and /avatar-studio/ paths
+ // are deliberately NOT handled here: vercel.json routes both to the
+ // platform's own sculpting page (pages/avatar-studio.html), and the
+ // dev route map above mirrors that, so dev and prod agree.
+ if (path.startsWith('/avatar-studio/') && path !== '/avatar-studio/') {
const ext = path.split('.').pop().toLowerCase();
const mimes = {
js: 'application/javascript',
@@ -2137,6 +2132,12 @@ support: resolve(__dirname, 'pages/support.html'),
res.setHeader('Content-Type', mimes[ext] || 'application/octet-stream');
return createReadStream(fileDisk).pipe(res);
}
+ if (rel === 'index.html') {
+ res.statusCode = 503;
+ return res.end(
+ 'Character Studio build missing: run `npm run build --prefix character-studio`',
+ );
+ }
return next();
}
if (!filePath) return next();