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
docs(ops): redis playbook now matches the durable-fallback design
fudjia79b970454bc9
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex d3a33280b..b068c98ba 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -12,6 +12,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Crypto News Reader** (`/markets/news/article`) — Rich article reader for crypto news — full story extraction with AI summary, key points, sentiment, detected tickers, and related coverage from across the industry.- **Docs · What Agents Can Do — The Complete Dossier** (`/docs/agent-abilities`) — The complete map of every agent ability, researched from the shipped code: body, motion, mind, voice, identity, skills, screens, economy, the 23-ability wallet, worlds, and the developer platform — 15 chapters plus a per-ability deep dive for the entire Agent Wallet.- **Markets Hub** (`/markets`) — The three.ws markets hub — live global stats, the top 100 coins, breaking crypto news from 38 publisher feeds, a 662k-article news archive, and hero links to the full markets toolset.+- **A leftover test file stops loading on every visit, and the docs match the code again** — A one-off test page and its 1.5 MB script were committed by mistake months ago and had been sitting in the public folder ever since, downloadable by anyone and adding dead weight to the site. Both are gone, and the project now refuses to accept that kind of leftover again. Alongside that, the twelve behind-the-scenes services that turn your photos and prompts into 3D models finally have written guides explaining what each one does, and a batch of documentation links that pointed at pages which no longer existed now lead somewhere real. `[fix, docs]`- **Auto-rigging works again — and the Agent Identity Studio demos are real** — Rigging any generated model into an animation-ready character had been failing since the cloud migration: the rig request was sent to a service that doesn't do rigging, and the GPU rigger itself crashed on a graphics call our cloud GPUs don't support. Both are fixed — rig requests now reach the real UniRig worker, which renders its voxel pass in software instead. Proof: all four Agent Identity Studio demo characters (LedgerLynx, MuseWeaver, Momentum-9, and the three.ws studio's own) were generated, rigged with full skeletons, and photographed in posed renders through the live pipeline — see them on the showcase. (`/agent-identities`) `[fix, feature]`- **Coin buybacks and vault balances work again** — A wiring mistake in how the platform opened its connection to Solana meant every automated buyback silently failed — for nearly a month, roughly 40,000 times a day — and the vault-balance view for any agent coin returned an error instead of its numbers. Both are fixed. Buybacks now run against the chain as intended, agent coin pages show real payment, buyback and withdraw vault balances again, and the failed-run log that quietly grew to a quarter-million rows is now pruned automatically while every on-chain burn record is kept. (`/launches`) `[fix]`- **Coin price charts stop dropping out, and the walk demos load fast on phones** — The price chart on coin and trading pages intermittently showed "unavailable" because every refresh asked the upstream price service for a slightly different time window, so nothing could be cached and the free service rate-limited us. Refreshes now share a window, the busiest lookup is remembered, and if both price sources go quiet for a moment the chart keeps showing the most recent real candles with a "delayed" marker instead of an error. A coin that has no liquidity pool now says exactly that. Separately, the walk landing page used to start all eight interactive demos at once — on a phone that exhausted the browser's 3D limit and stalled the page for over twenty seconds. Each demo now starts as you scroll to it. (`/walk`) `[fix, improvement]`@@ -20,6 +21,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Friends now see you online — and can message you — while you're in /play** — Your account's friends list, presence, and DMs (already live on /walk) now work inside /play's coin worlds too: a Friends button on the HUD (or press J) opens a drawer showing who's online and where, with live direct messages that arrive instantly whether or not the drawer is open. Previously /play never told the server who you were signed in as, so friends saw you as offline no matter how long you played, and any message sent your way was silently lost. (`/play`) `[feature, fix]`- **News Digest: the day's crypto coverage, grouped into the stories that actually matter** — Reading 90 headlines to find the 8 things that happened is a chore. /markets/digest does it for you: it reads every story from all 38 publisher feeds over your chosen window (6 hours to 3 days) and groups them into distinct narratives — each with a plain-language summary, whether it reads bullish or bearish, the coins involved, and an expandable list of every outlet that covered it. When an AI provider is available it groups the stories semantically; otherwise it clusters them by keyword and ticker overlap. Either way, every story links back to the real articles behind it — nothing is invented. (`/markets/digest`) `[feature]`- **Pages no longer rate-limit themselves during normal browsing** — A single request budget was shared across roughly 166 endpoints, so ordinary pages that load several panels at once — agent profiles, the markets dashboards, the galaxy view, the activity feed — could exhaust it and start showing "too many requests" errors to the person browsing. Market data, agent profiles and the galaxy each have their own budget now, and the shared one has far more headroom. `[fix, infra]`+- **Payments, withdrawals and minting stay up even when the rate limiter's cache goes down** — The service that counts requests had spent its monthly allowance, and by design every money-moving action — checkout, withdrawal, minting, trading — refused to run whenever that counter was unavailable. Because the allowance only refills at the start of a month, that would have meant three weeks of failures on paid features. Those actions now keep their limits in the main database instead, so they stay both protected and available. Ordinary page loads no longer spend the same allowance, and the status page now says plainly when the allowance has run out rather than pointing at a network problem that isn't there. (`/status`) `[fix, infra]`- **The autonomous agent loop stops retrying payments it can't afford** — The platform runs an autonomous loop that pays its own paid endpoints in USDC, so the agent economy keeps moving on its own. It had two limits: a daily spending cap, and the actual balance in its wallet. Only the cap was being checked. When the wallet ran dry, the loop kept building and submitting payments it could never fund — roughly one failed attempt every minute, indefinitely. Nothing was ever lost (the payments failed before any money moved, and no network fees were burned), but the loop did no useful work and leaned on the Solana network for nothing. It now reads its own balance first and simply skips the paid calls when the float is empty, while its free and monitoring work carries on untouched. The moment the wallet is topped up, spending resumes on its own. We also made the platform's alerting status visible on the health endpoint, so a missing alert channel can no longer look identical to a healthy, quiet one. `[fix, infra]`- **The blog is back — 30 posts were silently redirecting to the changelog** — Every /blog post, including the IBM, AWS, Google Cloud and Alibaba Cloud partnership announcements, was being redirected to the changelog even though the articles were still published and linked from Pricing, Partners and Tutorials. The posts are readable again at their original URLs. (`/blog`) `[fix]`- **The liquidations pulse on /coins is live** — The long/short liquidation strip on the markets page had been showing its offline state since launch — the collector that listens to Binance, Bybit, and OKX futures streams needs to run around the clock, which the old serverless setup couldn't do. It now runs as its own always-on service, so the dominant-side badge, the 1-hour long-vs-short bars, and the biggest recent liquidations fill in with real exchange data. (`/coins`) `[feature, infra]`diff --git a/docs/ops/redis.md b/docs/ops/redis.mdindex 6a717b256..a7f88e0e0 100644--- a/docs/ops/redis.md+++ b/docs/ops/redis.md@@ -2,14 +2,56 @@The platform's distributed rate limiters and the shared cache run on a singleUpstash Redis store. On the free plan that store has a hard ceiling of-**500,000 commands/month**. When the ceiling is hit, every `critical: true`-limiter **fails closed** — which blocks every paid forge generation and every-x402 payment platform-wide. This is not theoretical: in early June 2026 the-previous store burned ~42,000 commands/day and exhausted the quota in ~12 days,-taking the paid surface down for all users.+**500,000 commands/month**. When the ceiling is hit Upstash rejects *every*+command with `ERR max requests limit exceeded`, and the counter does not reset+until the plan period rolls over — so an exhausted store stays dead for days or+weeks, not minutes.++This is not theoretical. It has happened twice:++- **June 2026** — the previous store burned ~42,000 commands/day and exhausted+ the quota in ~12 days.+- **2026-07-09** — the store hit 500,000/500,000 on day 10 of the month. Because+ `critical: true` limiters then **failed closed**, every paid forge generation,+ checkout, withdrawal, mint and trade would have returned 503 for the remaining+ three weeks of the period.++**That fail-closed disposition is gone.** A `critical` or auth bucket now degrades+onto a durable **Postgres counter** (`rate_limit_counters`) when Redis cannot+answer — distributed, surviving instance fan-out, and costing one upsert. See+_Fallback behaviour_ below. Postgres is already a hard dependency of every+money-moving endpoint, so if it is down the action could not have succeeded+anyway; a limiter outage no longer takes the paid product with it.This doc is the deliberate-decision playbook: what burns quota, how to see the-burn before it's a crisis, and when/how to upgrade.+burn before it's a crisis, what happens when Redis goes blind, and when/how to+upgrade.++## Fallback behaviour++Which backend decides a request, in priority order:++| Bucket kind | Redis healthy | Redis blind (outage or over quota) | Redis + Postgres both down |+|---|---|---|---|+| `critical` (money, spend) | Redis sliding window | **Postgres** fixed window | deny (fail closed) |+| `degradeToMemory` (auth, login) | Redis sliding window | **Postgres** fixed window | per-instance memory (never lock everyone out) |+| plain (read/flood guards) | Redis sliding window | fail **open** | fail open |+| `local: true` | per-instance memory — never touches Redis or Postgres | same | same |++Two properties worth knowing:++- **The Postgres window is fixed, not sliding.** A caller can spend its full+ budget at the end of one window and again at the start of the next, i.e. up to+ 2× `limit` across the seam. That is an accepted tradeoff on a fallback path: a+ bounded burst during an outage beats either unbounded spend or a dead paid+ product, and a fixed window is settled by one atomic+ `INSERT … ON CONFLICT DO UPDATE … RETURNING hits` with no read-modify-write race.+- **A circuit breaker fronts Redis** (`rate-limit.js`, mirroring `cache.js`).+ Without it every rate-limited request paid a full failing round-trip before+ reaching its fallback — a ~300ms tax on every API call during the 2026-07-09+ incident. After 5 consecutive failures Redis is skipped entirely for an+ escalating cooldown (5s → 10s → … → 10min), with a single trial command+ admitted per cooldown to detect recovery.## Upstash plan management@@ -42,9 +84,24 @@ hunch.See `api/_lib/rate-limit.js` — limiters marked `local: true` use **zero Rediscommands** (per-instance in-memory enforcement). Eligible candidates: status-polllimiters, public health-check limiters, public read endpoints, cron rate guards.-**Never mark a `critical: true` limiter as `local`** — the fail-closed behavior-on a missing/exhausted Redis is the correct safety behavior for money-moving-operations.+**Never mark a `critical: true` limiter as `local`** — a money bucket must be+bounded across instances, and `local` bounds nothing but a single container.++The biggest single burn reduction available is keeping *reads* off Redis. A read+guard fires on every page load; a money bucket fires on a purchase. Sizing them+the same way is what spends the allowance the money buckets need. Already moved+to `local` for exactly this reason (2026-07-10):++| Bucket | Was | Why `local` is right |+|---|---|---|+| `authed:read:ip` | 300/5m on Redis | the hottest limiter on the platform — fires on every authenticated page load; guards scraping of data the caller may already read |+| `mcp:ip` / `mcp:user` | 600/1m, 1200/1m on Redis | MCP transport flood guards; the *paid* MCP tools keep their own `critical` distributed buckets |+| `wallet:read` | 60/1m on Redis | balance/holdings **reads** polled by open dashboards; sends and withdrawals keep distributed buckets |++Also: do not reach for `limits.authIp` as a generic "authenticated endpoint"+limiter. It is the strict credential bucket (50/10m, sized for login+brute-force). Use `limits.authedReadIp` for session-scoped reads, and mint a+dedicated bucket for a sensitive write (`agentCreateIp` is the model).## Visibility@@ -158,6 +215,18 @@ to `local` (no Redis command) or must stay Redis-backed.`tokenPriceIp`, `widgetRead`, `pinStatusIp` moved to `local`; burn-rate blockadded to `/api/forge?health`; projected-quota Telegram alert added to theforge-smoke cron; this doc created.+- **2026-07-09** — store hit 500,000/500,000 on day 10 of the period. Diagnosis+ was slowed by `/healthz` advising the timeout remedy+ (`CACHE_REDIS_CMD_TIMEOUT_MS`) for what was actually an exhausted allowance —+ commands were being *rejected*, not running slow.+- **2026-07-10** — the fail-closed disposition replaced with a durable Postgres+ fallback (`rate_limit_counters`, migration `20260710120000`), so money and auth+ buckets stay bounded instead of denying for the rest of the plan period. A+ circuit breaker was added in front of Redis (there was none — only `cache.js`+ had one), ending the failing round-trip on every request. `authedReadIp`,+ `mcpIp`, `mcpUser` and `walletRead` moved to `local`, and 38 read-only call+ sites were moved off the strict `authIp` credential bucket. `/healthz` gained a+ `rate_limiter` subsystem and now names an exhausted allowance explicitly.## Data durabilitydiff --git a/public/changelog.json b/public/changelog.jsonindex 0869452ed..96567a870 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-10T12:49:27.850Z",+ "generated_at": "2026-07-10T12:51:57.291Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -66,6 +66,17 @@"launch"]},+ {+ "date": "2026-07-10",+ "type": "update",+ "title": "A leftover test file stops loading on every visit, and the docs match the code again",+ "summary": "A one-off test page and its 1.5 MB script were committed by mistake months ago and had been sitting in the public folder ever since, downloadable by anyone and adding dead weight to the site. Both are gone, and the project now refuses to accept that kind of leftover again. Alongside that, the twelve behind-the-scenes services that turn your photos and prompts into 3D models finally have written guides explaining what each one does, and a batch of documentation links that pointed at pages which no longer existed now lead somewhere real.",+ "link": null,+ "tags": [+ "fix",+ "docs"+ ]+ },{"date": "2026-07-10","type": "update",@@ -150,6 +161,17 @@"infra"]},+ {+ "date": "2026-07-10",+ "type": "update",+ "title": "Payments, withdrawals and minting stay up even when the rate limiter's cache goes down",+ "summary": "The service that counts requests had spent its monthly allowance, and by design every money-moving action — checkout, withdrawal, minting, trading — refused to run whenever that counter was unavailable. Because the allowance only refills at the start of a month, that would have meant three weeks of failures on paid features. Those actions now keep their limits in the main database instead, so they stay both protected and available. Ordinary page loads no longer spend the same allowance, and the status page now says plainly when the allowance has run out rather than pointing at a network problem that isn't there.",+ "link": "/status",+ "tags": [+ "fix",+ "infra"+ ]+ },{"date": "2026-07-10","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex 45ce99606..725b6f7b4 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -54,6 +54,14 @@<category>launch</category><description>The three.ws markets hub — live global stats, the top 100 coins, breaking crypto news from 38 publisher feeds, a 662k-article news archive, and hero links to the full markets toolset.</description></item>+ <item>+ <title>A leftover test file stops loading on every visit, and the docs match the code again</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-07-10:A leftover test file stops loading on every visit, and the docs match the code again</guid>+ <pubDate>Fri, 10 Jul 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>A one-off test page and its 1.5 MB script were committed by mistake months ago and had been sitting in the public folder ever since, downloadable by anyone and adding dead weight to the site. Both are gone, and the project now refuses to accept that kind of leftover again. Alongside that, the twelve behind-the-scenes services that turn your photos and prompts into 3D models finally have written guides explaining what each one does, and a batch of documentation links that pointed at pages which no longer existed now lead somewhere real.</description>+ </item><item><title>Auto-rigging works again — and the Agent Identity Studio demos are real</title><link>https://three.ws/agent-identities</link>@@ -118,6 +126,14 @@<category>fix</category><description>A single request budget was shared across roughly 166 endpoints, so ordinary pages that load several panels at once — agent profiles, the markets dashboards, the galaxy view, the activity feed — could exhaust it and start showing "too many requests" errors to the person browsing. Market data, agent profiles and the galaxy each have their own budget now, and the shared one has far more headroom.</description></item>+ <item>+ <title>Payments, withdrawals and minting stay up even when the rate limiter's cache goes down</title>+ <link>https://three.ws/status</link>+ <guid isPermaLink="false">2026-07-10:Payments, withdrawals and minting stay up even when the rate limiter's cache goes down</guid>+ <pubDate>Fri, 10 Jul 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>The service that counts requests had spent its monthly allowance, and by design every money-moving action — checkout, withdrawal, minting, trading — refused to run whenever that counter was unavailable. Because the allowance only refills at the start of a month, that would have meant three weeks of failures on paid features. Those actions now keep their limits in the main database instead, so they stay both protected and available. Ordinary page loads no longer spend the same allowance, and the status page now says plainly when the allowance has run out rather than pointing at a network problem that isn't there.</description>+ </item><item><title>The autonomous agent loop stops retrying payments it can't afford</title><link>https://three.ws/changelog</link>diff --git a/public/features.json b/public/features.jsonindex 7fa85dc7b..36281c25f 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-10T12:39:43.934Z",+ "generated_at": "2026-07-10T12:51:57.278Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",