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(play): stop a blocked extra or a flaky fetch from faking a boot failure

nirholasa0a4da83bbed
diff --git a/pages/play.html b/pages/play.html
index b0e2745a5..3203c7b4b 100644
--- a/pages/play.html
+++ b/pages/play.html
@@ -88,6 +88,51 @@
</div>
</div>
+ <script>
+ /* Deep-link identity on the loader, inline on purpose: the app bundle takes a
+ moment to arrive, and for that whole window a shared world link showed a
+ generic "COIN COMMUNITIES / Joining the community…" with no hint of WHICH
+ community. Everything needed is already in the URL, so paint it now. The tab
+ title moves too, so a link parked in a background tab reads as the world it
+ opens. The app re-asserts both once it knows the real coin. */
+ (function () {
+ try {
+ var p = new URLSearchParams(location.search);
+ if (!p.get('coin')) return;
+ var trim = function (s, max) { return (s || '').trim().replace(/\s+/g, ' ').slice(0, max); };
+ var name = trim(p.get('name'), 28);
+ var sym = trim(p.get('symbol'), 12).replace(/^\$/, '').toUpperCase();
+ /* Only same-origin paths (the /api/img proxy) and https URLs. Anything
+ else in a shared link is not art we should point an <img> at. */
+ var raw = (p.get('image') || '').trim();
+ var art = (raw.charAt(0) === '/' && raw.charAt(1) !== '/') || /^https:\/\//i.test(raw) ? raw : '';
+ if (!name && !sym && !art) return;
+
+ var box = document.querySelector('.kx-boot-coin');
+ var img = box.querySelector('img');
+ /* Monogram stand-in: shown until the art decodes, and kept for good if
+ the fetch fails (an IPFS gateway on a bad venue connection), so the
+ slot is never a broken-image glyph. */
+ box.querySelector('.kx-boot-coin-mono').textContent = (sym || name || '?').charAt(0).toUpperCase();
+ if (art) {
+ img.addEventListener('load', function () { box.classList.add('kx-boot-coin-ok'); });
+ img.addEventListener('error', function () { img.remove(); });
+ img.src = art;
+ } else {
+ img.remove();
+ }
+ box.querySelector('.kx-boot-coin-name').textContent = name || 'Coin community';
+ box.querySelector('.kx-boot-coin-sym').textContent = sym ? '$' + sym : '';
+ box.hidden = false;
+ document.querySelector('.kx-loading-card').classList.add('kx-has-coin');
+
+ var label = sym ? '$' + sym : name;
+ document.querySelector('.kx-loading-sub').textContent = 'Entering ' + (name || label) + '…';
+ if (label) document.title = label + ' · Play — three.ws';
+ } catch (e) { /* the generic loader stands in */ }
+ })();
+ </script>
+
<!--
The world itself is a keyboard stop, not a decorative image: Tab lands
here, the label says what it is and how to drive it, and role=application
diff --git a/src/game/coincommunities.js b/src/game/coincommunities.js
index 634367ae3..5d5ffce77 100644
--- a/src/game/coincommunities.js
+++ b/src/game/coincommunities.js
@@ -1979,7 +1979,6 @@ export class CoinCommunities {
this._previewPresetId = null; this._previewLayers = false; this._previewItem = null;
for (const [, r] of this.remotes) r.dispose();
this.remotes.clear();
- this._pendingStale = null;
closeAvatarInspector(); // whoever it showed just left the world with us
if (this._totem) { this._disposeObject3D(this._totem); this.world.remove(this._totem); this._totem = null; this._coinSpin = null; }
if (this._screen) {
@@ -3606,6 +3605,9 @@ export class CoinCommunities {
this.ui.setForgeBusy(true);
const status = (m) => this.ui.setPropUploadStatus(m || '');
try {
+ // Only reachable from the Forge form / `/forge` chat command, so the lane
+ // client loads with the first forge rather than with the world.
+ const { forgeWorldProp } = await import('./forge-prop.js');
const out = await forgeWorldProp({ prompt, file, onStatus: status });
const def = registerUploadedProp(out.url, { name: out.name });
this.ui.addUploadedProp({ id: def.id, name: def.name });
@@ -3622,8 +3624,11 @@ export class CoinCommunities {
this.ui.toast('This model is on temporary storage, so the world may refuse it. If placing fails, forge it again.', 'warn');
}
} catch (err) {
- if (err instanceof ForgeError && err.cancelled) return;
- const message = err instanceof ForgeError ? err.message : 'The forge hit an error. Try again in a moment.';
+ // The lane client is loaded lazily above, so identify its errors by their
+ // own name rather than by a class binding this scope may not hold.
+ const fromLane = err?.name === 'ForgeError';
+ if (fromLane && err.cancelled) return;
+ const message = fromLane ? err.message : 'The forge hit an error. Try again in a moment.';
this.ui.setPropUploadStatus(message, true);
this.ui.toast(message, 'warn');
} finally {