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
feat: enhance agent profile resilience and dashboard improvements
udvk4d96e4df010e
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex f5bbfe9b2..2dc8f3470 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -13,6 +13,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Agent Activity is now a live trading floor — Conviction Board rail, richer trade detail and a real KPI bar that never shows an empty void** — The /activity page used to go blank whenever no agent had traded recently. It no longer does. A new Conviction Board rail sits alongside the feed with three always-on cards: Top Agents ranked by win rate and ROI, the biggest 24-hour conviction movers, and the best proven wins by ATH multiple — so there's live signal to act on even between trades. An insight strip surfaces the single standout in each. The KPI bar now reads from the Oracle stats engine, so Agents armed, Coins scored 24h, Open positions, Win rate and Best ATH show real numbers immediately. Each action row gained detail it always had but never displayed: the entry market cap, the agent's reason for the trade, how long the position was held, peak multiple, and a one-click Solscan link for live fills. Plus a type-to-filter box (press /), an Escape-to-clear, a press-r refresh, a '↑ N new' jump pill when trades land while you've scrolled, and a designed empty state that points you to arm the first agent. (`/activity`) `[feature, improvement]`- **Agent editor redesigned — one unified page instead of 15 sidebar tabs** — The agent editor no longer makes you click through 15 tabs to configure your agent. Everything — Persona, Outfit, Voice, Brain, Knowledge, Mind Palace, Dreams, Skills, Autopilot, Publish, Embed, Widgets, Social, Monetization, Wallet, Analytics, Studio, and Danger zone — is now visible at once in a single scrollable page. The 3D avatar preview is pinned permanently on the left so you always see your agent while you work. A sticky section nav (Identity / Brain / Distribute / Money / Advanced) lets you jump to any area instantly. (`/agent-edit`) `[improvement]`- **Agent profile pages no longer fail to load over a hiccup** — Opening an agent's profile (/agents/<id>) could show a full-page "Couldn't load this agent" error even when the agent was perfectly fine — a brief stumble in a side service (skill pricing, or the avatar self-heal check) was allowed to take down the whole profile. Those extras are now best-effort: if one can't answer in the moment, the page degrades gracefully and still renders the agent instead of erroring out. The page also quietly retries once on a transient network blip before ever showing the error screen, so cold loads and flaky connections recover on their own. (`/agents`) `[fix]`+- **Agent profile pages render again** — Every agent profile (/agents/<id>) had stopped loading — the page sat on its loading skeleton and never revealed the agent. The cause was the new living, idle-animated 3D avatar on the profile: it sets up its 3D stage before the avatar model has loaded, and that setup step assumed a model was already present, throwing an error that took the whole page down with it. The setup now handles the not-yet-loaded state cleanly, so the profile renders immediately and the avatar comes to life as soon as its model arrives. Every agent page — custom avatar or default body — loads correctly again. (`/agents`) `[fix]`- **Alpha Co-pilot overhauled — agent gallery, cited-signal highlights, score bars, and live routing fixed** — The Alpha Co-pilot page has been fully redesigned. A scrollable agent gallery loads at the top of the page populated from the public directory so any visitor immediately sees and can select a real agent — no UUID required. The page auto-loads the featured agent on arrival so the 3D avatar, live launches, and feed are live from the first paint. Launch cards now show SM and Quality score bars in green / amber / red so you can judge a mint at a glance, and the top-scoring launch gets a 'Top pick' badge. The verdict panel displays a spoken-line quote in a blockquote, a conviction gauge whose color matches the verdict (green for snipe, amber for watch, red for pass), a 'What could go wrong' risk list, and highlighted signals — the exact rows the agent cited are lit up in the signals grid. A missing Vercel routing entry for /api/agents/:id/alpha/* was added so the read and candidates endpoints now work end-to-end in production. (`/alpha-copilot`) `[feature, improvement]`- **Animation Studio — avatars no longer break when you switch animations** — In the /pose Animation Studio, playing one animation preset and then a second one used to mangle the avatar — limbs would lock up in the wrong position (arms stuck overhead while "walking", a forearm bent 90° off). The studio was measuring the rig's resting shape from whatever pose the previous clip left it in, instead of its true neutral pose, so every correction after the first was computed against a distorted baseline. It now always reads the avatar's real rest pose, so each animation retargets cleanly no matter how many you preview in a row — and the exported GLB matches what you see. (`/pose`) `[fix]`- **Animation Studio gains undo, mirror, and copy/paste posing** — Posing an avatar in the Animation Studio is now far quicker. Undo and redo cover every edit — gizmo rotations, slider tweaks, IK drags, presets, and resets — so you can experiment freely (Ctrl/Cmd+Z to step back, Shift+Z or Ctrl+Y forward). A new Mirror button flips the whole pose left ↔ right in one click, so you only have to pose one side of a symmetric stance, wave, or fighting guard. And you can now Copy a pose and Paste it onto another keyframe or a freshly loaded avatar without exporting a file. Mirroring works on any rigged avatar — not just the mannequin — because it reflects each joint in world space and reprojects it onto that rig's own skeleton. Keyboard shortcuts: M to mirror, C to copy, V to paste. (`/pose`) `[feature, improvement]`diff --git a/api/_lib/audit.js b/api/_lib/audit.jsindex 4c27b1a93..9c0b47350 100644--- a/api/_lib/audit.js+++ b/api/_lib/audit.js@@ -37,7 +37,19 @@ export function logAudit({ userId, action, resourceId = null, meta = null, req =values (${userId}, ${action}, ${resourceId}, ${meta}, ${resolvedIp}, ${resolvedUa})`, { timeoutMs: 5_000 });} catch (err) {- console.error('[audit] insert failed', { action, resourceId, error: err?.message });+ // A transient DB stall (Neon scale-to-zero wake, a connection blip — see+ // db-retry.js) is infrastructure, not a code fault: it drops this one+ // best-effort row but breaks nothing. Logging it at error level trips+ // false alarms, so classify it the same way db-retry/avatar-agent do and+ // warn instead; reserve error for genuinely unexpected failures.+ const detail = { action, resourceId, error: err?.message };+ const transient =+ err?.code === 'DB_TIMEOUT' ||+ /fetch failed|connecting to database|ECONNRESET|ECONNREFUSED|ETIMEDOUT|EAI_AGAIN|socket hang up|terminat/i.test(+ err?.message || '',+ );+ if (transient) console.warn('[audit] insert dropped (transient DB stall)', detail);+ else console.error('[audit] insert failed', detail);}});}diff --git a/api/_lib/cache.js b/api/_lib/cache.jsindex 6bf426b6a..179ba9a12 100644--- a/api/_lib/cache.js+++ b/api/_lib/cache.js@@ -117,6 +117,24 @@ let circuitFailures = 0;let circuitOpenUntil = 0; // epoch ms; 0 = closedlet circuitTrialInFlight = false;+// SET-path write suppression. The shared circuit breaker above keys off+// CONSECUTIVE command failures across all ops, but the production failure mode is+// a degraded Upstash that fails the large best-effort SETs while GETs stay fast+// and healthy (see the WARN_THROTTLE_MS note below). Every healthy GET resets+// circuitFailures before SET timeouts can reach the threshold, so the breaker+// stays (correctly) closed to keep serving cache reads — yet every SET still pays+// a full REDIS_CMD_TIMEOUT_MS stall and emits a warning, which is the actual log+// flood seen on hot endpoints (/api/galaxy/flows, /api/explore). The fix is a+// gate that counts SET failures on their OWN consecutive streak: once they reach+// SET_FAIL_THRESHOLD we suppress the Redis SET entirely for SET_SUPPRESS_MS —+// memory write only, no fetch, no per-request stall, no warning. One trial SET is+// admitted after the window; its success resumes writes. GET reads are never+// gated by this, so cache hits keep flowing throughout.+const SET_FAIL_THRESHOLD = 5;+const SET_SUPPRESS_MS = 60_000;+let setFailures = 0;+let setSuppressedUntil = 0; // epoch ms; 0 = writing normally+// Thrown when the circuit is open. Callers treat it as a normal cache miss but// skip the per-request warning, since the open/close transitions log once each.class CircuitOpenError extends Error {@@ -235,14 +253,39 @@ export async function cacheGet(key) {export async function cacheSet(key, value, ttlSeconds = 60) {if (!redisConfigured()) return memSet(key, value, ttlSeconds);+ // While SETs are known-degraded, skip Redis entirely — go straight to memory.+ // Saves the per-request REDIS_CMD_TIMEOUT_MS stall and the warning flood; one+ // trial SET is admitted once the window elapses to detect recovery.+ const now = Date.now();+ if (setSuppressedUntil !== 0 && now < setSuppressedUntil) {+ readMemo.delete(key);+ return memSet(key, value, ttlSeconds);+ }try {const payload = JSON.stringify(value);await redisCmd(['SET', key, payload, 'EX', String(ttlSeconds)]);+ if (setSuppressedUntil !== 0) console.warn('[cache] redis SET recovered — resuming cache writes');+ setFailures = 0;+ setSuppressedUntil = 0;memoPut(key, value); // keep the memo coherent with what we just wrote} catch (err) {- if (!err?.circuitOpen) warnThrottled('SET', `[cache] redis SET failed, using memory fallback: ${err?.message}`);readMemo.delete(key);memSet(key, value, ttlSeconds);+ if (err?.circuitOpen) return; // shared breaker already logged the open transition+ if (setSuppressedUntil !== 0) {+ // A post-window trial failed — Redis writes still down, re-arm quietly.+ setSuppressedUntil = now + SET_SUPPRESS_MS;+ return;+ }+ setFailures++;+ if (setFailures >= SET_FAIL_THRESHOLD) {+ setSuppressedUntil = now + SET_SUPPRESS_MS;+ console.warn(+ `[cache] redis SET degraded — suppressing cache writes for ${SET_SUPPRESS_MS / 1000}s after ${setFailures} consecutive failures; serving from memory`,+ );+ } else {+ warnThrottled('SET', `[cache] redis SET failed, using memory fallback: ${err?.message}`);+ }}}diff --git a/api/cron/three-holders-snapshot.js b/api/cron/three-holders-snapshot.jsindex 5490e02d1..d5971fb1c 100644--- a/api/cron/three-holders-snapshot.js+++ b/api/cron/three-holders-snapshot.js@@ -57,7 +57,14 @@ export default wrap(async (req, res) => {} catch (err) {// Never throw: a failed scan leaves the prior snapshot intact (the refresh// only deletes inside a successful scan), so public reads are unaffected.- console.error('[three-holders-snapshot] refresh failed:', err?.message || err);- return json(res, 200, { ok: false, refreshed: false, error: err?.message || String(err) });+ // A transient upstream blip — a `terminated` fetch, a Helius 429 cooldown,+ // a network reset — is expected operationally and self-heals on the next+ // 5-minute tick, so warn rather than error to keep it out of alerting;+ // reserve error for unexpected faults (a bug, a bad schema migration).+ const msg = err?.message || String(err);+ const transient = /terminated|fetch failed|ECONNRESET|ETIMEDOUT|EAI_AGAIN|socket hang up|429|rate.?limit|network/i.test(msg);+ if (transient) console.warn('[three-holders-snapshot] refresh deferred (transient upstream):', msg);+ else console.error('[three-holders-snapshot] refresh failed:', msg);+ return json(res, 200, { ok: false, refreshed: false, error: msg });}});diff --git a/data/changelog.json b/data/changelog.jsonindex 25061972e..a2696942c 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,13 @@{"$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-06-26",+ "title": "Agent profile pages render again",+ "summary": "Every agent profile (/agents/<id>) had stopped loading — the page sat on its loading skeleton and never revealed the agent. The cause was the new living, idle-animated 3D avatar on the profile: it sets up its 3D stage before the avatar model has loaded, and that setup step assumed a model was already present, throwing an error that took the whole page down with it. The setup now handles the not-yet-loaded state cleanly, so the profile renders immediately and the avatar comes to life as soon as its model arrives. Every agent page — custom avatar or default body — loads correctly again.",+ "tags": ["fix"],+ "link": "/agents"+ },{"date": "2026-06-26","title": "Fixed the marketplace's collapsed layout for good",diff --git a/public/changelog.json b/public/changelog.jsonindex 34df1dc0f..64354c537 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-26T12:28:34.290Z",+ "generated_at": "2026-06-26T12:38:26.692Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -78,6 +78,16 @@"fix"]},+ {+ "date": "2026-06-26",+ "type": "update",+ "title": "Agent profile pages render again",+ "summary": "Every agent profile (/agents/<id>) had stopped loading — the page sat on its loading skeleton and never revealed the agent. The cause was the new living, idle-animated 3D avatar on the profile: it sets up its 3D stage before the avatar model has loaded, and that setup step assumed a model was already present, throwing an error that took the whole page down with it. The setup now handles the not-yet-loaded state cleanly, so the profile renders immediately and the avatar comes to life as soon as its model arrives. Every agent page — custom avatar or default body — loads correctly again.",+ "link": "/agents",+ "tags": [+ "fix"+ ]+ },{"date": "2026-06-26","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex c7573649a..4d68d2bc1 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -62,6 +62,14 @@<category>fix</category><description>Opening an agent's profile (/agents/<id>) could show a full-page "Couldn't load this agent" error even when the agent was perfectly fine — a brief stumble in a side service (skill pricing, or the avatar self-heal check) was allowed to take down the whole profile. Those extras are now best-effort: if one can't answer in the moment, the page degrades gracefully and still renders the agent instead of erroring out. The page also quietly retries once on a transient network blip before ever showing the error screen, so cold loads and flaky connections recover on their own.</description></item>+ <item>+ <title>Agent profile pages render again</title>+ <link>https://three.ws/agents</link>+ <guid isPermaLink="false">2026-06-26:Agent profile pages render again</guid>+ <pubDate>Fri, 26 Jun 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>Every agent profile (/agents/<id>) had stopped loading — the page sat on its loading skeleton and never revealed the agent. The cause was the new living, idle-animated 3D avatar on the profile: it sets up its 3D stage before the avatar model has loaded, and that setup step assumed a model was already present, throwing an error that took the whole page down with it. The setup now handles the not-yet-loaded state cleanly, so the profile renders immediately and the avatar comes to life as soon as its model arrives. Every agent page — custom avatar or default body — loads correctly again.</description>+ </item><item><title>Alpha Co-pilot overhauled — agent gallery, cited-signal highlights, score bars, and live routing fixed</title><link>https://three.ws/alpha-copilot</link>diff --git a/public/features.json b/public/features.jsonindex 9c4c641ea..1e8de312f 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-26T12:28:34.267Z",+ "generated_at": "2026-06-26T12:38:26.673Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/src/arena/arena.js b/src/arena/arena.jsindex 5622cdda5..6ee265295 100644--- a/src/arena/arena.js+++ b/src/arena/arena.js@@ -443,6 +443,7 @@ function paintDetail(data) {),t.description ? h('p', { class: 'desc' }, t.description) : null,detailStats(data, phase),+ windowTimeline(t, phase),h('div',{ class: 'hero-actions' },@@ -469,11 +470,12 @@ function paintDetail(data) {const body = h('div',{ class: 'detail-body' },- spotlight,+ h('div', { class: 'detail-aside' }, spotlight, prizeLadder(data, phase), rulesPanel(data)),h('div',- {},+ { class: 'detail-main' },phase === 'finished' ? resultsBanner(data) : null,+ aggregateStrip(standings, t),h('div',{ class: 'board-head' },diff --git a/src/viewer.js b/src/viewer.jsindex 05f73eef2..d7ddf4b9c 100644--- a/src/viewer.js+++ b/src/viewer.js@@ -1329,22 +1329,27 @@ export class Viewer {this.skeletonHelpers.forEach((helper) => this.scene.remove(helper));}- traverseMaterials(this.content, (material) => {- material.wireframe = this.state.wireframe;-- if (material instanceof PointsMaterial) {- material.size = this.state.pointSize;- }- });+ // May run before any model has loaded (e.g. idle-avatar configures the+ // viewer up front, then loads the GLB). The material/skeleton passes need+ // content; the grid/auto-rotate state below does not, so skip just these.+ if (this.content) {+ traverseMaterials(this.content, (material) => {+ material.wireframe = this.state.wireframe;++ if (material instanceof PointsMaterial) {+ material.size = this.state.pointSize;+ }+ });- this.content.traverse((node) => {- if (node.geometry && node.skeleton && this.state.skeleton) {- const helper = new SkeletonHelper(node.skeleton.bones[0].parent);- helper.material.linewidth = 3;- this.scene.add(helper);- this.skeletonHelpers.push(helper);- }- });+ this.content.traverse((node) => {+ if (node.geometry && node.skeleton && this.state.skeleton) {+ const helper = new SkeletonHelper(node.skeleton.bones[0].parent);+ helper.material.linewidth = 3;+ this.scene.add(helper);+ this.skeletonHelpers.push(helper);+ }+ });+ }if (this.state.grid !== Boolean(this.gridHelper)) {if (this.state.grid) {diff --git a/tests/cache-circuit-breaker.test.js b/tests/cache-circuit-breaker.test.jsindex d942bb484..2ed7685f3 100644--- a/tests/cache-circuit-breaker.test.js+++ b/tests/cache-circuit-breaker.test.js@@ -58,4 +58,49 @@ describe('cache circuit breaker', () => {const openWarnings = warn.mock.calls.filter((c) => String(c[0]).includes('circuit opened'));expect(openWarnings).toHaveLength(1);});++ it('suppresses SET writes when SETs fail but GETs stay healthy (shared breaker stays closed)', async () => {+ // Production failure mode: a degraded Upstash fails the large best-effort+ // SETs while GETs stay fast. Each healthy GET resets the shared breaker's+ // consecutive-failure counter, so it never opens — yet without a SET-path+ // gate every SET keeps paying a stall and logging. The SET gate must trip on+ // its own streak and then stop touching the network for writes.+ //+ // Fresh module instance so the previous test's tripped breaker/suppression+ // (module-level state) doesn't leak in and pre-arm this scenario.+ vi.resetModules();+ const { cacheGet, cacheSet } = await import('../api/_lib/cache.js');+ const isSet = (init) => {+ try { return JSON.parse(init.body)[0] === 'SET'; } catch { return false; }+ };+ const fetchMock = vi.fn(async (_url, init) => {+ if (isSet(init)) throw new Error('The operation was aborted due to timeout');+ // GET succeeds (Upstash returns { result: <raw> }); null result = miss.+ return { ok: true, json: async () => ({ result: null }) };+ });+ globalThis.fetch = fetchMock;+ const warn = vi.spyOn(console, 'warn').mockImplementation(() => {});++ // Interleave a healthy GET before each failing SET so the SHARED breaker's+ // consecutive counter is reset every iteration and never reaches its+ // threshold — isolating the SET-path gate.+ for (let i = 0; i < 5; i++) {+ await cacheGet(`setgate:get:${i}`);+ await cacheSet(`setgate:set:${i}`, { v: i }, 30);+ }+ // The shared breaker never opened (GETs kept it closed).+ const noOpen = warn.mock.calls.filter((c) => String(c[0]).includes('circuit opened'));+ expect(noOpen).toHaveLength(0);+ // The SET gate tripped exactly once after its 5 consecutive failures.+ const suppress = warn.mock.calls.filter((c) => String(c[0]).includes('suppressing cache writes'));+ expect(suppress).toHaveLength(1);++ // Writes are now suppressed: a further SET must NOT hit the network, but a+ // GET still must (reads stay live throughout a write outage).+ const callsBefore = fetchMock.mock.calls.length;+ await cacheSet('setgate:after', { v: 'x' }, 30);+ expect(fetchMock).toHaveBeenCalledTimes(callsBefore); // SET skipped the network+ await cacheGet('setgate:after-get');+ expect(fetchMock.mock.calls.length).toBeGreaterThan(callsBefore); // GET still went out+ });});