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.

Free-lane reliability: bound GLB render concurrency, widen the 3D submit window

nirholas847b8101ff7b
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2cea57b7c..4344cca7b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -25,6 +25,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Markets data now survives outages with five new free sources** — The markets hub picked up a deeper safety net of free public data sources. Bitcoin, Ethereum and Solana price charts and headline prices now fall back to live exchange data (Kraken, Coinbase, Bitfinex) whenever the primary aggregator is rate-limited, so the /coins charts keep drawing instead of going blank. The /derivatives perp table gains a Hyperliquid backup with live funding, open interest and volume for about 200 contracts. Solana token panels add Raydium's own pool index as a final price source, and the paid Market Mood endpoint now includes Deribit's DVOL implied-volatility index for BTC and ETH at no extra cost. (`/coins`) `[improvement, infra]`
- **Motion Swap now captures hands and fingers** — Motion capture from video just got hands. When you swap yourself for your avatar at /motion-swap, the capture now tracks both hands (21 points each) and solves every finger joint, so waves, counting, pointing, and sign-language handshapes come through on your avatar instead of a stiff flat hand. Wrist rotation is also solved from the palm itself, making hand orientation far more faithful. Works with any rigged avatar; if your hands leave the frame the capture holds the last hand pose instead of snapping flat. (`/motion-swap`) `[improvement]`
- **Motion Swap: replace yourself in a video with your 3D avatar** — Upload a video of yourself (a house tour, a demo, a walk-through) at /motion-swap and get it back with your avatar performing your exact motion instead of you. The platform tracks your body pose in every frame, masks you out, and pins your chosen avatar over you, matching your position and size; you stay pixelated underneath. Compositing and video export run right in your browser, and any rigged humanoid GLB works, including avatars you generated or captured from a selfie. (`/motion-swap`) `[feature]`
+- **Steadier free 3D generation and model snapshots** — Two reliability fixes for the free lanes: the model snapshot renderer no longer fails under a burst of simultaneous requests (renders now queue instead of overloading the server, with more memory behind them), and free text-to-3D requests no longer time out early when the primary GPU provider is degraded; the fallback lane now gets the time it needs to finish your model. `[fix, infra]`
- **Switch any coin chart between CoinGecko, TradingView, DexScreener, and GeckoTerminal** — The chart on every /coin page now has a source switcher. Start on the fast native CoinGecko line chart, then flip to TradingView's advanced candlesticks, or to the DexScreener or GeckoTerminal on-chain terminal for the token's live DEX pair. Each option only appears when it can actually chart that coin, your pick is remembered across coins and visits, and every view follows the site theme. (`/coin/bitcoin`) `[feature, improvement]`
- **The assistant widget ships as an npm package and an MCP server** — The 3D avatar assistant widget is now installable three ways. Beyond the one-tag script, there is an npm package, @three-ws/assistant, for bundler projects (the one-tag build is generated from it, so they never drift), and a free MCP server, @three-ws/assistant-mcp, published to the official Model Context Protocol registry as io.github.nirholas/assistant-widget. Any AI agent (Claude Code, Cursor, Claude Desktop) can now ask for a widget in plain language and get back a paste-ready embed: build_assistant_widget turns a config into a script tag, a frame URL, and a ThreeAssistant.init() call, and list_assistant_options returns every avatar, background, and mode. Full developer docs at /docs/assistant-widget and a step-by-step tutorial walk through every option, the JavaScript API, and the agent workflow. (`/docs/assistant-widget`) `[sdk, feature, docs]`
- **The ChatGPT studio now shows its work, and goes up to High** — Making a 3D model in ChatGPT now feels like the Forge. The generator paints a concept image before sculpting the mesh, and ChatGPT now shows that painted view the moment it exists, while the 3D model is still generating: in the inline widget it appears instantly as the model loads behind it. You can also ask for quality now: draft for speed, standard by default, or high for maximum detail on our own GPUs (it takes a few minutes and is worth it). Under the hood, ChatGPT requests ride the same smart engine routing as the Forge page instead of a single pinned engine, so an unhealthy lane never blocks your model. (`/docs/chatgpt-ar`) `[feature, improvement]`
diff --git a/api/3d/generate.js b/api/3d/generate.js
index 9c8813c48..72e4d7c5a 100644
--- a/api/3d/generate.js
+++ b/api/3d/generate.js
@@ -269,7 +269,19 @@ async function generate(req, res) {
let job;
try {
// Pin the free draft lane exactly: NVIDIA NIM TRELLIS, image path, draft tier.
- job = await startForge(base, { prompt, backend: 'nvidia', path: 'image', tier: 'draft' });
+ // Wide submit window (240s vs the 90s default): when NIM is degraded the
+ // draft falls to the blocking HF Spaces lane, whose queue + inference can
+ // legitimately run past 90s. Consumers of this endpoint poll anyway, so a
+ // slower inline completion strictly beats aborting the self-call at 90s,
+ // 503ing the caller, and finishing the GPU work for nobody (the 2026-07-18
+ // lane_timeout window: every one of those 503s was exactly 90s old).
+ job = await startForge(base, {
+ prompt,
+ backend: 'nvidia',
+ path: 'image',
+ tier: 'draft',
+ submitTimeoutMs: 240_000,
+ });
} catch (err) {
return failFromLane(res, err);
}
@@ -356,7 +368,8 @@ export default wrap(async (req, res) => {
return poll(req, res, jobId, title);
});
-// The free NIM draft often finishes inside the submit window; startForge waits up
-// to 90s for that inline completion. Give the function headroom beyond the default
-// so a fast draft returns done in one call instead of forcing a poll.
-export const config = { maxDuration: 120 };
+// The free NIM draft often finishes inside the submit window; startForge waits
+// up to 240s for that inline completion (wide enough for the blocking HF
+// fallback lane's queue). Give the function headroom beyond that window so a
+// slow draft returns done in one call instead of a gateway timeout.
+export const config = { maxDuration: 300 };
diff --git a/api/_lib/env.js b/api/_lib/env.js
index 9182fbba3..6c125707b 100644
--- a/api/_lib/env.js
+++ b/api/_lib/env.js
@@ -1504,6 +1504,14 @@ export const env = {
return opt('CHROMIUM_PACK_URL');
},
+ // Cap on simultaneous chromium GLB renders per container (render-glb.js).
+ // Each render holds a software-GL WebGL page plus the GLB's decoded buffers;
+ // unbounded parallelism OOM-killed the 2Gi container under a 5-render burst
+ // (2026-07-18). Raise only alongside the service's memory limit.
+ get RENDER_GLB_CONCURRENCY() {
+ return opt('RENDER_GLB_CONCURRENCY');
+ },
+
// CZ Agent campaign — on-chain registry contract for the transfer flow.
// Set CZ_REGISTRY_CONTRACT to the deployed identity registry address.
// CZ_AGENT_ID and CZ_AGENT_NAME can override the defaults.
diff --git a/api/_lib/render-glb.js b/api/_lib/render-glb.js
index 5e078b74a..ac2420fac 100644
--- a/api/_lib/render-glb.js
+++ b/api/_lib/render-glb.js
@@ -102,6 +102,31 @@ export function isBrowserInfrastructureError(err) {
return INFRA_ERROR_RE.test(String(err?.message || err || ''));
}
+// Bound simultaneous renders per container. Each render runs a software-GL
+// WebGL scene in its own chromium page while holding the GLB's decoded
+// buffers; a parallel burst stacked enough of those to push the container past
+// its memory limit, and Cloud Run OOM-killed it mid-request (observed
+// 2026-07-18: every in-flight render surfaced as a 502). Renders beyond the
+// cap wait FIFO for a slot; the endpoint's per-IP rate limit bounds how deep
+// the queue can grow.
+const MAX_CONCURRENT_RENDERS = Math.max(1, Number(env.RENDER_GLB_CONCURRENCY) || 2);
+let _activeRenders = 0;
+const _renderWaiters = [];
+
+function acquireRenderSlot() {
+ if (_activeRenders < MAX_CONCURRENT_RENDERS) {
+ _activeRenders += 1;
+ return Promise.resolve();
+ }
+ return new Promise((resolve) => _renderWaiters.push(resolve));
+}
+
+function releaseRenderSlot() {
+ const next = _renderWaiters.shift();
+ if (next) next();
+ else _activeRenders -= 1;
+}
+
// Inline viewer HTML — bundled into the function so the renderer needs no
// extra static assets. three.js + GLTFLoader load from unpkg pinned to the
// installed version. window.__renderDone signals readiness to puppeteer.
@@ -263,6 +288,27 @@ export async function renderGlbToPng({ glbUrl, width = 1200, height = 630, backg
code: err?.code || 'glb_fetch_failed',
});
}
+ await acquireRenderSlot();
+ try {
+ try {
+ return await renderOnce({ glbBase64, width, height, background, backdrop });
+ } catch (err) {
+ // The shared browser can die mid-render (an OOM-reaped chromium takes
+ // every in-flight page with it). That says nothing about this GLB: the
+ // disconnect handler already evicted the corpse, so one retry lands on
+ // a freshly launched browser instead of surfacing an infra blip as a
+ // render failure.
+ if (!isBrowserInfrastructureError(err)) throw err;
+ return await renderOnce({ glbBase64, width, height, background, backdrop });
+ }
+ } finally {
+ releaseRenderSlot();
+ }
+}
+
+// One page lifecycle on the shared browser: boot page, load the inline viewer,
+// wait for the first clean frame, screenshot.
+async function renderOnce({ glbBase64, width, height, background, backdrop }) {
const browser = await getBrowser();
const page = await browser.newPage();
try {
diff --git a/api/_mcp-studio/forge-client.js b/api/_mcp-studio/forge-client.js
index 5f11cee8d..ae492e642 100644
--- a/api/_mcp-studio/forge-client.js
+++ b/api/_mcp-studio/forge-client.js
@@ -89,7 +89,14 @@ function internalHeaders() {
// OR when the high lane can't hand back a job in time (the free Hunyuan3D lane
// blocks the whole request instead of returning a poll handle, which no ChatGPT
// surface can wait out).
-export async function startForge(base, { prompt, imageUrls, aspect, backend, path, tier, internal }) {
+// `submitTimeoutMs` sets how long the caller is willing to hold the submit open
+// before giving up (default 90s). The blocking free lanes (HF Spaces) can take
+// well past 90s under a queue while still finishing fine server-side; a caller
+// whose consumers poll anyway (the public /api/3d/generate) passes a wider
+// window so a slow-but-working lane returns done instead of burning the GPU
+// work into a client-side timeout. Interactive surfaces keep the 90s default.
+export async function startForge(base, { prompt, imageUrls, aspect, backend, path, tier, internal, submitTimeoutMs }) {
+ const submitWindowMs = Number(submitTimeoutMs) > 0 ? Number(submitTimeoutMs) : 90_000;
const attempt = async (tierId, withInternal) => {
const payload = {
...(prompt ? { prompt } : {}),
@@ -105,7 +112,7 @@ export async function startForge(base, { prompt, imageUrls, aspect, backend, pat
method: 'POST',
headers: { 'content-type': 'application/json', ...(withInternal ? internalHeaders() : {}) },
body: JSON.stringify(payload),
- signal: AbortSignal.timeout(90_000),
+ signal: AbortSignal.timeout(submitWindowMs),
});
} catch (err) {
if (err?.name === 'TimeoutError' || err?.name === 'AbortError')
diff --git a/data/changelog.json b/data/changelog.json
index 96c6d956b..296b11dbc 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-07-19",
+ "title": "Steadier free 3D generation and model snapshots",
+ "summary": "Two reliability fixes for the free lanes: the model snapshot renderer no longer fails under a burst of simultaneous requests (renders now queue instead of overloading the server, with more memory behind them), and free text-to-3D requests no longer time out early when the primary GPU provider is degraded; the fallback lane now gets the time it needs to finish your model.",
+ "tags": [
+ "fix",
+ "infra"
+ ]
+ },
{
"date": "2026-07-19",
"title": "Daily Match: a live daily agent arena",
diff --git a/public/changelog.json b/public/changelog.json
index 57ca01b25..744f637d9 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-07-19T15:04:56.972Z",
+ "generated_at": "2026-07-19T15:09:18.622Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -206,6 +206,17 @@
"feature"
]
},
+ {
+ "date": "2026-07-19",
+ "type": "update",
+ "title": "Steadier free 3D generation and model snapshots",
+ "summary": "Two reliability fixes for the free lanes: the model snapshot renderer no longer fails under a burst of simultaneous requests (renders now queue instead of overloading the server, with more memory behind them), and free text-to-3D requests no longer time out early when the primary GPU provider is degraded; the fallback lane now gets the time it needs to finish your model.",
+ "link": null,
+ "tags": [
+ "fix",
+ "infra"
+ ]
+ },
{
"date": "2026-07-19",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index 00d152050..8cd9b53bc 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -158,6 +158,14 @@
<category>feature</category>
<description>Upload a video of yourself (a house tour, a demo, a walk-through) at /motion-swap and get it back with your avatar performing your exact motion instead of you. The platform tracks your body pose in every frame, masks you out, and pins your chosen avatar over you, matching your position and size; you stay pixelated underneath. Compositing and video export run right in your browser, and any rigged humanoid GLB works, including avatars you generated or captured from a selfie.</description>
</item>
+ <item>
+ <title>Steadier free 3D generation and model snapshots</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-07-19:Steadier free 3D generation and model snapshots</guid>
+ <pubDate>Sun, 19 Jul 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>Two reliability fixes for the free lanes: the model snapshot renderer no longer fails under a burst of simultaneous requests (renders now queue instead of overloading the server, with more memory behind them), and free text-to-3D requests no longer time out early when the primary GPU provider is degraded; the fallback lane now gets the time it needs to finish your model.</description>
+ </item>
<item>
<title>Switch any coin chart between CoinGecko, TradingView, DexScreener, and GeckoTerminal</title>
<link>https://three.ws/coin/bitcoin</link>
diff --git a/public/features.json b/public/features.json
index e846600b0..6ff872769 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-07-19T15:04:56.957Z",
+ "generated_at": "2026-07-19T15:09:18.606Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
diff --git a/tests/discover-rename.test.js b/tests/discover-rename.test.js
index aaa38229e..94d5c907d 100644
--- a/tests/discover-rename.test.js
+++ b/tests/discover-rename.test.js
@@ -105,7 +105,8 @@ describe('discover/my-agents rename — static page contents', () => {
const path = p('public/discover/index.html');
expect(existsSync(path)).toBe(true);
const html = readFileSync(path, 'utf8');
- expect(html).toContain('<title>Discover · three.ws</title>');
+ // The title tag may carry attributes (the i18n pass adds data-i18n).
+ expect(html).toMatch(/<title[^>]*>Discover · three\.ws<\/title>/);
expect(html).toContain('ERC-8004 Agent Directory');
});
@@ -113,7 +114,8 @@ describe('discover/my-agents rename — static page contents', () => {
const path = p('public/my-agents/index.html');
expect(existsSync(path)).toBe(true);
const html = readFileSync(path, 'utf8');
- expect(html).toContain('<title>My Agents · three.ws</title>');
+ // The title tag may carry attributes (the i18n pass adds data-i18n).
+ expect(html).toMatch(/<title[^>]*>My Agents · three\.ws<\/title>/);
// Page heading uses "My Agents" (renamed from "On-chain Agents").
expect(html).toMatch(/My Agents|On-chain Agents/);
});
diff --git a/tests/render-glb-concurrency.test.js b/tests/render-glb-concurrency.test.js
new file mode 100644
index 000000000..8003f9466
--- /dev/null
+++ b/tests/render-glb-concurrency.test.js
@@ -0,0 +1,111 @@
+// Tests for the renderer's per-container concurrency cap and its
+// infra-error retry. Both exist because of the 2026-07-18 incident: a burst of
+// parallel renders stacked enough chromium pages to OOM the container, and the
+// resulting browser death surfaced as user-facing 502s. The GLB fetch and the
+// browser are both stubbed, so these run fast and headless everywhere.
+
+import { describe, it, expect, vi, afterEach } from 'vitest';
+
+vi.mock('../api/_lib/fetch-model.js', () => ({
+ fetchModel: vi.fn(async () => ({ bytes: new Uint8Array([1, 2, 3]) })),
+}));
+
+const PNG_BYTES = Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]);
+
+// A controllable stand-in for the puppeteer browser: every page renders
+// successfully after `pageDelayMs`, unless a queued failure says otherwise.
+function makeFakeBrowser({ pageDelayMs = 25, failures = [] } = {}) {
+ const state = { open: 0, maxOpen: 0, pagesCreated: 0 };
+ const browser = {
+ connected: true,
+ on() {},
+ async newPage() {
+ state.pagesCreated += 1;
+ state.open += 1;
+ state.maxOpen = Math.max(state.maxOpen, state.open);
+ const failure = failures.shift() || null;
+ return {
+ async setViewport() {},
+ async setContent() {},
+ async waitForFunction() {
+ await new Promise((r) => setTimeout(r, pageDelayMs));
+ if (failure) throw new Error(failure);
+ },
+ async evaluate() {
+ return null;
+ },
+ async screenshot() {
+ return PNG_BYTES;
+ },
+ async close() {
+ state.open -= 1;
+ },
+ };
+ },
+ };
+ return { browser, state };
+}
+
+afterEach(async () => {
+ const { __setBrowserForTests } = await import('../api/_lib/render-glb.js');
+ __setBrowserForTests(null);
+});
+
+describe('renderGlbToPng — bounded concurrency', () => {
+ it('never runs more pages than the cap, but completes every queued render', async () => {
+ const { renderGlbToPng, __setBrowserForTests } = await import('../api/_lib/render-glb.js');
+ const { browser, state } = makeFakeBrowser();
+ __setBrowserForTests(browser);
+
+ const results = await Promise.all(
+ Array.from({ length: 6 }, () => renderGlbToPng({ glbUrl: 'https://example.com/m.glb' })),
+ );
+
+ expect(results).toHaveLength(6);
+ for (const png of results) expect(png[0]).toBe(0x89);
+ // Default cap is 2 (RENDER_GLB_CONCURRENCY unset in tests).
+ expect(state.maxOpen).toBeLessThanOrEqual(2);
+ expect(state.pagesCreated).toBe(6);
+ });
+});
+
+describe('renderGlbToPng — infra-error retry', () => {
+ it('retries once when the browser dies mid-render', async () => {
+ const { renderGlbToPng, __setBrowserForTests } = await import('../api/_lib/render-glb.js');
+ const { browser, state } = makeFakeBrowser({
+ failures: ['Protocol error (Page.captureScreenshot): Target closed.'],
+ });
+ __setBrowserForTests(browser);
+
+ const png = await renderGlbToPng({ glbUrl: 'https://example.com/m.glb' });
+ expect(png[0]).toBe(0x89);
+ expect(state.pagesCreated).toBe(2);
+ });
+
+ it('does not retry a genuine render failure', async () => {
+ const { renderGlbToPng, __setBrowserForTests } = await import('../api/_lib/render-glb.js');
+ const { browser, state } = makeFakeBrowser();
+ // A page whose viewer reports a model-side error: evaluate returns the error.
+ browser.newPage = async () => {
+ state.pagesCreated += 1;
+ return {
+ async setViewport() {},
+ async setContent() {},
+ async waitForFunction() {},
+ async evaluate() {
+ return 'glb parse failed: bad chunk';
+ },
+ async screenshot() {
+ return PNG_BYTES;
+ },
+ async close() {},
+ };
+ };
+ __setBrowserForTests(browser);
+
+ await expect(renderGlbToPng({ glbUrl: 'https://example.com/m.glb' })).rejects.toThrow(
+ /render failed: glb parse failed/,
+ );
+ expect(state.pagesCreated).toBe(1);
+ });
+});