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.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
fix(home): record a mid-connection drop, so a stopped house stops reading Live
nirholasa9b7252217a7
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex d40e4af8d..eedcdfb09 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -7,6 +7,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr## 2026-09-10- **3D assets now load on any website, not just ours**: Files served straight from our asset storage carried a permission list that only named a handful of sites, so a browser on any other site quietly threw the file away after downloading it. Anyone embedding a three.ws avatar or model from its direct storage link saw an empty viewer with a cross-origin error, and the workarounds were our /cdn and /api/glb routes. Storage now allows reads from everywhere while keeping uploads locked to our own pages, so direct links work in any embed. This also fixed a first-party case: the www version of the site served every page correctly but had all of its 3D blocked. `[fix, infra]`+- **A smart home that stops answering now says so, instead of reading Live**: If your house went offline while three.ws already had a connection open to it, the home card could keep showing Live, updated moments ago for as long as you watched. The live 3D scene knew and went stale correctly, but the stored status did not, so anything reading it (the card, the home list, a wall display) kept describing a house that was gone as healthy. A house dropping out is now recorded the moment it is noticed, and recorded again when it comes back, so every surface agrees. This was invisible on a first visit and permanent on a busy one, which is why it survived so long. (`/smart-home`) `[fix]`- **Generated motion clips rebuilt so they no longer slide across the floor**: The generated half of the animation library was written in the wrong rest pose and carried a constant forward drift that was never in the original motion, which made characters glide instead of plant their feet. Every published clip was re-derived from the motion already generated, re-checked against the quality gate, and republished: 39 clips that now pass are live, and the 94 that still failed on foot-sliding were withdrawn rather than left on the shelf. No new generation was needed, because the motion was correct all along and only written down wrong. (`/animations`) `[fix, improvement]`- **The image check now moves on when a model answers in the wrong format**: Generated models are inspected by a vision model before you see them, and that inspection asks several providers in turn so one being busy is never the end of it. The catch was that a provider only had to reply, not reply usefully: a model that narrated its thinking instead of returning the requested format counted as the answer, and the healthy providers waiting behind it were never asked. A reply the check cannot read is now treated as that provider failing, so it moves straight to the next one, and it only gives up once every provider has been tried. The practical effect is that the quality check returns a real verdict far more often, and when it cannot, the reason it reports names the provider that actually lost. `[fix, improvement]`- **Two scheduled jobs that had never once run are now running**: The daily portfolio snapshot and the 15-minute global events ingest were both declared and deployed but had no schedule attached, so neither had ever fired. Both are now scheduled and enabled. The events feed backfills a few files per tick rather than all at once, and the snapshot refuses to record a day it cannot price properly, so neither one writes a hole into history while it catches up. `[fix, infra]`diff --git a/api/_lib/home/runtime.js b/api/_lib/home/runtime.jsindex 620b9979f..c3c85efdf 100644--- a/api/_lib/home/runtime.js+++ b/api/_lib/home/runtime.js@@ -564,6 +564,8 @@ export function createHomeRuntime(deps = {}) {openedAt: now(),stale: false,status: HOME_STATUS.PENDING,+ /** What the database row is believed to say, so persistStatus only writes transitions. */+ persistedStatus: null,lastGraph: { floors: [], rooms: [], unassigned: [] },subscribers: new Set(),closed: false,@@ -641,11 +643,13 @@ export function createHomeRuntime(deps = {}) {entry.stale = true;entry.status = HOME_STATUS.UNREACHABLE;notify(entry, bridge);+ persistStatus(entry, HOME_STATUS.UNREACHABLE, 'This home stopped answering three.ws. It reconnects on its own when it comes back.');});bridge.on('reconnected', () => {entry.stale = false;entry.status = HOME_STATUS.CONNECTED;notify(entry, bridge);+ persistStatus(entry, HOME_STATUS.CONNECTED, null);});bridge.on('error', (err) => {// Once per socket, not once per message: a malformed burst must not be@@ -661,6 +665,38 @@ export function createHomeRuntime(deps = {}) {});}+ /**+ * Write a mid-connection status change through to the database.+ *+ * `onConnectSuccess` and `onConnectFailure` only ever run inside the initial+ * `entry.ready` promise, so before this existed the ONLY way a house's stored+ * status changed was a fresh connect attempt. A pooled entry never takes that+ * path again: `acquire` finds it in `entries`, awaits an already-resolved+ * `ready`, and hands the bridge straight back. The liveness ping still noticed+ * the house was gone and still told every live subscriber, but the row kept+ * saying `connected` with its old `last_ok_at` and no `last_error_at`.+ *+ * That is invisible on a cold pool and permanent on a warm one, which is+ * exactly the shape it was found in: a stopped house read "Live, updated+ * moments ago" for as long as anyone watched, but only when an earlier request+ * had left a socket in the pool. `/api/home` and the `isDegraded` judgement in+ * `src/home/manage.js` both read the row, so the wall display this whole+ * mechanism exists to protect was the one surface still being lied to.+ *+ * Redundant writes are skipped rather than debounced: a house that flaps emits+ * one event per transition, and only a transition is worth a round trip.+ */+ function persistStatus(entry, status, statusDetail) {+ if (entry.persistedStatus === status) return;+ entry.persistedStatus = status;+ writeHandshake(entry.homeId, { status, statusDetail }).catch((err) => {+ // Let the next transition try again rather than pinning a value the+ // database never accepted.+ if (entry.persistedStatus === status) entry.persistedStatus = null;+ console.warn('[home-runtime] status change not recorded', { homeId: entry.homeId, status, ...safeError(err) });+ });+ }+function notify(entry, bridge) {if (!entry.subscribers.size) return;const event = eventFor(entry, bridge);@@ -684,6 +720,10 @@ export function createHomeRuntime(deps = {}) {function onConnectSuccess(homeId, entry, bridge) {breakers.delete(homeId);+ // Keep persistStatus's view of the row in step with what this write is+ // about to store, so the first mid-connection transition is judged against+ // the truth rather than against an empty field.+ entry.persistedStatus = HOME_STATUS.CONNECTED;const graph = entry.lastGraph;// Measured from the socket that just opened, never inferred. The store// merges capabilities, so writing the WebSocket half here cannot erase thediff --git a/data/changelog.json b/data/changelog.jsonindex c9f0a0a9b..7109c2bdf 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,15 @@{"$comment": "Curated changelog entries for three.ws, the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.","entries": [+ {+ "date": "2026-09-10",+ "title": "A smart home that stops answering now says so, instead of reading Live",+ "summary": "If your house went offline while three.ws already had a connection open to it, the home card could keep showing Live, updated moments ago for as long as you watched. The live 3D scene knew and went stale correctly, but the stored status did not, so anything reading it (the card, the home list, a wall display) kept describing a house that was gone as healthy. A house dropping out is now recorded the moment it is noticed, and recorded again when it comes back, so every surface agrees. This was invisible on a first visit and permanent on a busy one, which is why it survived so long.",+ "tags": [+ "fix"+ ],+ "link": "/smart-home"+ },{"date": "2026-09-10","title": "3D assets now load on any website, not just ours",diff --git a/public/changelog-recent.json b/public/changelog-recent.jsonindex 910f56471..af0a73a01 100644--- a/public/changelog-recent.json+++ b/public/changelog-recent.json@@ -1,11 +1,11 @@{- "generated_at": "2026-09-10T04:48:03.506Z",+ "generated_at": "2026-09-10T05:02:38.362Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws","url": "https://three.ws"},- "total": 3661,+ "total": 3662,"complete": false,"full_feed": "/changelog.json","entries": [@@ -20,6 +20,16 @@"infra"]},+ {+ "date": "2026-09-10",+ "type": "update",+ "title": "A smart home that stops answering now says so, instead of reading Live",+ "summary": "If your house went offline while three.ws already had a connection open to it, the home card could keep showing Live, updated moments ago for as long as you watched. The live 3D scene knew and went stale correctly, but the stored status did not, so anything reading it (the card, the home list, a wall display) kept describing a house that was gone as healthy. A house dropping out is now recorded the moment it is noticed, and recorded again when it comes back, so every surface agrees. This was invisible on a first visit and permanent on a busy one, which is why it survived so long.",+ "link": "/smart-home",+ "tags": [+ "fix"+ ]+ },{"date": "2026-09-10","type": "update",@@ -1606,16 +1616,6 @@"tags": ["fix"]- },- {- "date": "2026-09-05",- "type": "launch",- "title": "Docs · Pocket Console",- "summary": "How the /pocket handheld works: the D-pad and gamepad controls, the three cartridges, the URL params that make a share link, and the one iframe that puts a live 3D agent console on any site.",- "link": "/docs/pocket",- "tags": [- "launch"- ]}]}diff --git a/public/changelog.json b/public/changelog.jsonindex 510afb727..25653f169 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-09-10T04:48:03.485Z",+ "generated_at": "2026-09-10T05:02:38.338Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -17,6 +17,16 @@"infra"]},+ {+ "date": "2026-09-10",+ "type": "update",+ "title": "A smart home that stops answering now says so, instead of reading Live",+ "summary": "If your house went offline while three.ws already had a connection open to it, the home card could keep showing Live, updated moments ago for as long as you watched. The live 3D scene knew and went stale correctly, but the stored status did not, so anything reading it (the card, the home list, a wall display) kept describing a house that was gone as healthy. A house dropping out is now recorded the moment it is noticed, and recorded again when it comes back, so every surface agrees. This was invisible on a first visit and permanent on a busy one, which is why it survived so long.",+ "link": "/smart-home",+ "tags": [+ "fix"+ ]+ },{"date": "2026-09-10","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex 58694fd76..fc7a504ca 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -14,6 +14,14 @@<category>fix</category><description>Files served straight from our asset storage carried a permission list that only named a handful of sites, so a browser on any other site quietly threw the file away after downloading it. Anyone embedding a three.ws avatar or model from its direct storage link saw an empty viewer with a cross-origin error, and the workarounds were our /cdn and /api/glb routes. Storage now allows reads from everywhere while keeping uploads locked to our own pages, so direct links work in any embed. This also fixed a first-party case: the www version of the site served every page correctly but had all of its 3D blocked.</description></item>+ <item>+ <title>A smart home that stops answering now says so, instead of reading Live</title>+ <link>https://three.ws/smart-home</link>+ <guid isPermaLink="false">2026-09-10:A smart home that stops answering now says so, instead of reading Live</guid>+ <pubDate>Thu, 10 Sep 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>If your house went offline while three.ws already had a connection open to it, the home card could keep showing Live, updated moments ago for as long as you watched. The live 3D scene knew and went stale correctly, but the stored status did not, so anything reading it (the card, the home list, a wall display) kept describing a house that was gone as healthy. A house dropping out is now recorded the moment it is noticed, and recorded again when it comes back, so every surface agrees. This was invisible on a first visit and permanent on a busy one, which is why it survived so long.</description>+ </item><item><title>Generated motion clips rebuilt so they no longer slide across the floor</title><link>https://three.ws/animations</link>diff --git a/public/features.json b/public/features.jsonindex 83b06b014..ee08f300a 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-09-10T04:48:03.475Z",+ "generated_at": "2026-09-10T05:02:38.328Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/tests/home-runtime.test.js b/tests/home-runtime.test.jsindex 9f1618fd8..b66c1c9b4 100644--- a/tests/home-runtime.test.js+++ b/tests/home-runtime.test.js@@ -427,6 +427,78 @@ describe('home runtime: the graph goes stale, never empty', () => {runtime.closeAll();});+ it('writes a mid-connection drop through to the stored row, not just to subscribers', async () => {+ // The regression this locks in: onConnectSuccess and onConnectFailure only+ // run inside the initial ready promise, so a pooled bridge that dies while+ // checked out used to change nothing but memory. /api/home reads the row,+ // so a stopped house kept reporting connected with its old last_ok_at for+ // as long as the entry stayed pooled, and the card read "Live" over a house+ // that was gone.+ const createBridge = countingFactory();+ const deps = storeDeps();+ const runtime = createHomeRuntime({ createBridge, ...deps });++ await runtime.subscribe(HOME_ID, USER_ID, () => {});+ const bridge = createBridge.built[0];+ expect(deps.handshakes.at(-1)).toMatchObject({ id: HOME_ID, status: 'connected' });++ bridge.connected = false;+ bridge.emit('disconnected');+ await Promise.resolve();++ const recorded = deps.handshakes.at(-1);+ expect(recorded.id).toBe(HOME_ID);+ expect(recorded.status).toBe('unreachable');+ expect(recorded.statusDetail).toMatch(/stopped answering/i);+ runtime.closeAll();+ });++ it('records the recovery too, so a house that comes back stops reading unreachable', async () => {+ const createBridge = countingFactory();+ const deps = storeDeps();+ const runtime = createHomeRuntime({ createBridge, ...deps });++ await runtime.subscribe(HOME_ID, USER_ID, () => {});+ const bridge = createBridge.built[0];++ bridge.connected = false;+ bridge.emit('disconnected');+ await Promise.resolve();+ const afterDrop = deps.handshakes.length;+ bridge.connected = true;+ bridge.emit('reconnected');+ await Promise.resolve();++ // A fresh write, not the one the original connect left behind: asserting+ // only the last row's status passes even with the recovery path missing,+ // because onConnectSuccess already stored `connected`.+ expect(deps.handshakes.length).toBe(afterDrop + 1);+ expect(deps.handshakes.at(-1)).toMatchObject({ id: HOME_ID, status: 'connected' });+ runtime.closeAll();+ });++ it('does not spend a write on a repeated event that changes nothing', async () => {+ // A flapping house emits one event per transition; anything else is the+ // same fact arriving twice and is not worth a database round trip.+ const createBridge = countingFactory();+ const deps = storeDeps();+ const runtime = createHomeRuntime({ createBridge, ...deps });++ await runtime.subscribe(HOME_ID, USER_ID, () => {});+ const bridge = createBridge.built[0];++ bridge.connected = false;+ bridge.emit('disconnected');+ await Promise.resolve();+ const afterFirst = deps.handshakes.length;+ bridge.emit('disconnected');+ bridge.emit('disconnected');+ await Promise.resolve();++ expect(deps.handshakes.length).toBe(afterFirst);+ runtime.closeAll();+ });+it('comes back live on reconnect with no action from the client', async () => {const createBridge = countingFactory();const runtime = createHomeRuntime({ createBridge, ...storeDeps() });