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.

feat: oracle stats/backtest updates, solana connection and env improvements, brain studio tweaks

nirholaseae1f6465ad4
diff --git a/.gitignore b/.gitignore
index 656c46dd6..45e1a52e7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -257,3 +257,4 @@ pages/ibm/test.html
/solwallets.json
/bscwallets.json
three.ws-log-export-2026-06-20T06-40-10.json
+three.ws-log-export-2026-06-20T11-29-59.json
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b5d550836..080a7a2e0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Proof-of-Grind Gallery** (`/vanity/gallery`) — A public gallery and leaderboard of the rarest Solana vanity addresses ground on three.ws — each provably-fair, verified, and shareable. Appraise any address to see its honest rarity tier and grind cost.
- **/irl now pairs with smart glasses** — You can connect companion smart glasses to the /irl augmented-reality view and see the nearest agent right on your lens — its name, the direction to turn, how far away it is, and a flash when one walks into range. Your phone keeps doing all the GPS, compass and discovery work; the glasses just show the cue, so you can keep your head up instead of staring at a screen. Brilliant Labs Frame is fully supported (official SDK); Even Realities G1 works too via its two-arm pairing (experimental, community protocol). Pairing uses an encrypted Web Bluetooth link in Chromium browsers — your location is never sent to the glasses, only the direction and distance you already see on screen. (`/irl`) `[feature]`
- **Agents Index now shows every registered agent** — The Agents Index at /agents was reading from an empty source and showed "No public agents yet" even though hundreds of agents are registered across chains. It now reads from the live on-chain registry — the same feed Discover uses — so you can browse every registered agent, search them, see their services and x402 support, and open any one's detail page. Search, sorting and load-more all work against the real directory. (`/agents`) `[fix]`
+- **Brain Studio no longer crashes when opening “How this brain behaves” early** — In the agent Brain Studio, clicking “How this brain behaves” before the circuit canvas had finished loading could throw an error and leave the panel stuck. The behavior view now mounts the editor on demand, so it always opens — showing an empty-brain note if you haven't wired anything yet — instead of failing. `[fix]`
- **Choose where you walk — six environments for the Walk page** — Your avatar no longer strolls in one fixed studio. A new environment picker lets you drop into six distinct worlds: a sunlit Park with shade trees and benches, a neon Cyberpunk street, a bright Beach with palm trees and a turquoise sea, a white-walled Gallery with pedestals and hung art, an abstract Void grid for pure focus, and the three.ws Office with desks and plants. Open the picker from the environment button in the Walk HUD to see a preview of each scene, or press V to cycle through them. Switching fades smoothly to the new sky and back — the ground, lighting, reflections, and props all change to match, and the avatar walks and collides correctly in every world. Link straight to a scene with ?env=beach (or park, cyberpunk, gallery, void, office), and your last choice is remembered next time you visit. Every scene is a real 3D model with its own HDR lighting, authored and owned by three.ws. (`/features/walk`) `[feature]`
- **Compressed 3D avatars now load everywhere** — Generated and server-baked avatars are saved in a compressed format to keep them small and fast to download. On a number of pages — including the avatar results screen after a Forge or selfie creation — the 3D viewer wasn't set up to decompress them, so the model silently failed to appear. The viewer now loads the decompression decoder on every page that shows a 3D model, so your avatars render reliably no matter where they're displayed. `[fix]`
- **Create and manage your avatar's wallet right on its page** — If you own an avatar, its page now has the full Solana wallet built in — no more jumping to a separate settings screen. Generate a custodial wallet for the avatar's agent in one click, then use it from the same spot: see the SOL balance, copy the address, open it in an explorer, request a devnet airdrop, and watch recent on-chain activity. You can also grind a vanity address so the wallet starts with characters you choose, and the wallet badge on the page updates instantly when you do. Everything is owner-only and verified server-side; visitors just see the public address. `[feature]`
@@ -21,6 +22,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Launchpad polish pass — paid concierge & showroom pages now really charge, plus accessibility fixes across the trading desk** — We ran the whole pump.fun launchpad through a single quality sweep. Launchpad Studio's paid templates — the pay-per-question concierge and the pay-to-enter 3D showroom — now work end to end: visitors pay in USDC straight to the creator's own wallet, then get their answer or the unlocked scene (showroom scenes stay hidden until paid for). Coin cards across the new-launches feed, the live stream, and agent profiles now link to their three.ws coin profile instead of bouncing you off to pump.fun, so you stay on the platform. Every buy/sell, governance, and launch dialog is now fully keyboard-operable — Escape to close, focus stays inside the dialog, visible focus rings everywhere — and the live PumpPortal stream is labeled correctly with a working event counter and a 'quiet' indicator when the feed goes still. (`/launches`) `[improvement]`
- **Live token card on the home page is streaming again** — The 'Live token · Pump.fun' card on the home page was stuck on 'Loading live token…' and falling back to 'Live feed unavailable right now.' It now picks a real trending pump.fun coin — complete with its logo and market cap — and streams its live buys and sells again. The same fix restores the trending coin grid on the Communities page. `[fix]`
- **On-chain agent reputation attestations are minting reliably again** — The background job that records agents' on-chain milestones — token graduations, fee claims, whale trades — had stopped running because it could only read its signing key in one specific format. Now it accepts the key in any standard Solana format, so those reputation events post to the chain again, and a misconfigured key skips cleanly instead of taking the whole monitor down. `[fix]`
+- **Oracle “wins” and backtest now load instead of erroring** — The Oracle's track-record views — the list of called coins that pumped or graduated, plus the per-tier backtest and stats — were failing to load because of an internal database mismatch. They now query correctly, so you can see the Oracle's real hit-rate, best multiples, and graduation counts across any time window and tier. (`/oracle`) `[fix]`
- **Pick and switch avatars from the Walk Avatar extension popup** — The three.ws Walk Avatar browser extension popup is now a full avatar picker. Sign in straight from the popup — it opens three.ws, signs you in, and links the extension automatically — then browse your own avatars, a Featured shelf of community favorites, and a Recent tab of the avatars you've picked before. Tap any thumbnail to instantly swap the walking avatar on the current tab, drag the speed slider to change how fast it walks in real time, and use the big switch to turn it on or off for the site you're on. Every thumbnail is a real avatar from your account, with graceful empty, loading, and error states throughout. `[feature]`
- **Proof-of-grind: a public gallery of the rarest wallets ground here** — A vanity address is a flex — but until now the flex was unverifiable. Proof-of-grind turns it into provenance. Every provably-fair grind can now carry an honest rarity score and tier (Common → Mythic) computed straight from the real grind difficulty: longer patterns rank higher, with documented, capped bonuses for real dictionary words, palindromes, and repeated-character runs — no inflated numbers. Publish a wallet (opt-in, secret-free; we re-verify your signed receipt against the live three.ws service key before it appears) and it joins a public gallery and leaderboard of the rarest addresses ground on three.ws, sortable and filterable by tier and pattern, each with a verified badge and a beautiful share card for X. New tools: paste any address to appraise its tier and estimated grind cost, and every agent's wallet chip now shows its rarity tier wherever it appears. No secret, seed, or sealed key is ever stored or shown. (`/vanity/gallery`) `[feature, security, sdk]`
- **Real product analytics + the $THREE conversion funnel** — We now measure the journeys that matter so we can find and fix where people drop off. Every key step is captured as a real, privacy-respecting event: landing on the homepage and which call-to-action you click, connecting a wallet (started, succeeded, or failed), creating an agent, and copying an embed snippet. The $THREE holder funnel is fully instrumented end to end — token page view → buy clicked → swap quote shown → swap confirmed → swap settled on-chain — so we can see exactly how far buyers get. Marketplace searches, agent profile views, and dashboard/visualizer opens are tracked too, alongside failed API calls so reliability is visible. Wallet addresses are always truncated, events are queued so they never slow the page, and analytics can never break the app. `[improvement, infra]`
@@ -30,6 +32,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **The pricing page now reveals as you scroll** — The lower sections of the pricing page — the full feature comparison, the FAQ, and the closing call-to-action — now fade and rise gently into view as you scroll to them instead of sitting flat on the page, matching the staggered entrance the plan cards already had. The motion is purely cosmetic and gracefully turns itself off if you've asked your system to reduce motion, and the content always appears even on browsers that don't support scroll detection. (`/pricing`) `[improvement]`
- **The walking guide now strolls on phones and tablets** — The corner walk companion only knew how to follow a mouse cursor, so on touch devices — with no cursor to chase — it stood frozen in place. On phones and tablets it now wanders on its own, ambling between headings and pausing to look around, so the walk actually walks. Its dismiss and 'choose avatar' buttons, previously revealed only on hover, are now always tappable on touch, and the 'tap me to walk the whole page' invite reads right for a finger instead of a click. `[fix]`
- **Transaction history and the Brain Studio editor are stable again** — Two crashes are fixed. Your account's transaction history — every skill purchase and sale — was failing to load because of a database column mismatch; it now reads each payment's token decimals from the price record and renders the full ledger correctly. And in the agent Brain Studio, closing the 'How this brain behaves' preview before the circuit canvas had finished loading could throw an error; the editor now closes cleanly no matter when you dismiss it. (`/dashboard/account`) `[fix]`
+- **Vanity wallet grinding fails gracefully instead of timing out** — Generating a custom vanity address for an agent's wallet on the server could run past the request limit and return an unhelpful gateway timeout. It now stops cleanly within budget and tells you to grind longer patterns in the browser at /vanity-wallet (GPU-accelerated, up to 8 characters) — no more dead-end timeouts. (`/vanity-wallet`) `[fix]`
- **Walk Avatar browser extension — Chrome Web Store release package** — The Walk Avatar Chrome extension is packaged and ready to publish. It lets you walk your three.ws 3D avatar on any website you visit and, optionally, have it read page sections aloud. This release adds a real privacy policy and terms of service (at three.ws/extension/privacy and three.ws/extension/terms), a one-command production build that minifies and zips the extension for upload, and a full set of store-listing images captured from the real product. We also fixed the in-page avatar so it loads correctly — the default and compressed avatars now render reliably — and the popup's Featured tab now shows public avatars without signing in. (`/extension/privacy`) `[feature, fix]`
- **Walk Avatar extension gets a full settings page** — The three.ws Walk Avatar browser extension now has a dedicated settings page (open it from the popup's "All settings" link or chrome://extensions → Details → Extension options). Choose your default avatar, where it appears on a page (including a new follow-the-cursor mode), its size, walk speed, and a light/dark/auto theme that reads each page's background. Turn on read-aloud narration and pick from real synthesis voices, and set per-site allow and block lists so the avatar only shows up where you want it. Every change saves instantly and roams across your signed-in Chrome installs, with a one-click reset to defaults and a diagnostics panel showing your session and extension version. `[feature]`
- **Walk Avatar reads articles aloud more cleanly** — When you turn on read-aloud narration in the Walk Avatar browser extension, it now isolates the real article on a page before speaking — using Mozilla's Readability engine to strip away navigation, headers, footers, sidebars and ads — so the avatar narrates the actual story you're reading instead of menu labels or boilerplate. As you scroll, it follows the section in view, shows the text in a tidy speech bubble above the avatar (now neatly clamped to three lines), and reads it with a real synthesis voice; muting silences it and cancels any in-flight audio instantly. Narration stays off when you've asked your system to reduce motion. `[improvement]`
diff --git a/api/_lib/env.js b/api/_lib/env.js
index 6738185ae..9713d1fbe 100644
--- a/api/_lib/env.js
+++ b/api/_lib/env.js
@@ -38,6 +38,28 @@ function normalizeAppOrigin(raw) {
}
}
+// Repair the recurring `api-mainnet.helius-rpc.com` / `api-devnet.helius-rpc.com`
+// misconfiguration (Helius's JSON-RPC host is `mainnet.helius-rpc.com`, not the
+// `api.helius.xyz` REST host) before the URL reaches any Solana caller. A bad host
+// 404s every request and gets parked in a 30m cooldown forever; rewriting it keeps
+// SOLANA_RPC_URL a working primary. Kept dependency-free so env.js stays light —
+// mirrors normalizeRpcUrl() in solana/connection.js. Unrecognized URLs pass through.
+function normalizeRpcUrl(raw) {
+ const v = (raw ?? '').trim();
+ if (!v) return v;
+ try {
+ const u = new URL(v);
+ const fixed = u.hostname.replace(/^api-(mainnet|devnet)\.helius-rpc\.com$/i, '$1.helius-rpc.com');
+ if (fixed !== u.hostname) {
+ u.hostname = fixed;
+ return u.toString();
+ }
+ return v;
+ } catch {
+ return v;
+ }
+}
+
// Platform owner wallets with standing admin access, independent of env config.
// Public addresses, safe to commit. Unioned with ADMIN_ADDRESSES (see below).
const BUILT_IN_ADMIN_ADDRESSES = ['9MjzHaTB6Jko4YKo9mDzJSaGnktzhbebgsnqPpYWnXC7'];
@@ -676,7 +698,7 @@ export const env = {
// Solana RPC URL — single source of truth for all Solana RPC calls.
// Set to a Helius/QuickNode/Triton URL in production to avoid public RPC rate limits.
get SOLANA_RPC_URL() {
- return opt('SOLANA_RPC_URL', 'https://api.mainnet-beta.solana.com');
+ return normalizeRpcUrl(opt('SOLANA_RPC_URL', 'https://api.mainnet-beta.solana.com'));
},
// Helius API key — extracted from SOLANA_RPC_URL when it's a Helius endpoint,
@@ -693,7 +715,7 @@ export const env = {
// Solana devnet RPC URL. Falls back to the public devnet endpoint.
get SOLANA_RPC_URL_DEVNET() {
- return opt('SOLANA_RPC_URL_DEVNET', 'https://api.devnet.solana.com');
+ return normalizeRpcUrl(opt('SOLANA_RPC_URL_DEVNET', 'https://api.devnet.solana.com'));
},
// ── threews.sol subdomain minting ─────────────────────────────────────
diff --git a/api/_lib/erc8004-chains.js b/api/_lib/erc8004-chains.js
index abf0caa95..6d5689570 100644
--- a/api/_lib/erc8004-chains.js
+++ b/api/_lib/erc8004-chains.js
@@ -232,7 +232,11 @@ export const CHAINS = [
testnet: true,
registry: IDENTITY_REGISTRY_TESTNET,
explorer: 'https://sepolia-optimism.etherscan.io',
- rpcUrls: ['https://sepolia.optimism.io', 'https://optimism-sepolia.publicnode.com'],
+ rpcUrls: [
+ 'https://sepolia.optimism.io',
+ 'https://optimism-sepolia.publicnode.com',
+ 'https://optimism-sepolia.drpc.org',
+ ],
},
{
id: 80002,
diff --git a/api/_lib/pump-vanity.js b/api/_lib/pump-vanity.js
index 445dd4ba3..8cc4c0878 100644
--- a/api/_lib/pump-vanity.js
+++ b/api/_lib/pump-vanity.js
@@ -15,6 +15,10 @@ const BASE58_CHARS = new Set(BASE58_ALPHABET);
const MAX_PATTERN_LENGTH = 6;
const DEFAULT_MAX_ITERATIONS = 2_000_000;
const YIELD_EVERY = 10_000;
+// Wall-clock deadline is checked more often than we yield so a maxMs budget
+// overshoots by at most ~this-many keypairs (a fraction of a second) instead of
+// a full YIELD_EVERY block — keeps a serverless grind well inside maxDuration.
+const TIME_CHECK_EVERY = 2_000;
function validatePattern(pattern, label) {
if (typeof pattern !== 'string' || pattern.length === 0) {
@@ -67,6 +71,9 @@ export function estimateAttempts({ prefix, suffix, ignoreCase = false } = {}) {
* @param {string} [opts.suffix] — required base58 suffix
* @param {boolean} [opts.ignoreCase] — case-insensitive match
* @param {number} [opts.maxIterations] — hard cap (default 2M)
+ * @param {number} [opts.maxMs] — wall-clock budget in ms (default Infinity). Bails
+ * with a `vanity_timeout` error before this elapses so a serverless invocation
+ * returns a clean 504 instead of being hard-killed by the platform's runtime limit.
* @param {(attempts:number,rate:number)=>void} [opts.onProgress] — every 1k attempts
* @returns {Promise<{ keypair: Keypair, iterations: number, durationMs: number }>}
*/
@@ -75,6 +82,7 @@ export async function grindMintKeypair({
suffix,
ignoreCase = false,
maxIterations = DEFAULT_MAX_ITERATIONS,
+ maxMs = Infinity,
onProgress,
} = {}) {
if (!prefix && !suffix) {
@@ -90,10 +98,24 @@ export async function grindMintKeypair({
const sLen = targetSuffix?.length || 0;
const start = Date.now();
+ const deadline = Number.isFinite(maxMs) ? start + maxMs : Infinity;
let lastProgressAt = start;
let lastProgressAttempts = 0;
+ const timeout = (attempts) =>
+ Object.assign(
+ new Error(
+ `vanity ${prefix ? `prefix '${prefix}'` : ''}${prefix && suffix ? ' + ' : ''}${suffix ? `suffix '${suffix}'` : ''} not found in ${attempts.toLocaleString()} attempts (estimated ~${Math.round(estimateAttempts({ prefix, suffix, ignoreCase })).toLocaleString()})`,
+ ),
+ { status: 504, code: 'vanity_timeout' },
+ );
+
for (let i = 1; i <= maxIterations; i++) {
+ // Cheap, frequent deadline check so a wall-clock budget bails promptly.
+ if (deadline !== Infinity && i % TIME_CHECK_EVERY === 0 && Date.now() >= deadline) {
+ throw timeout(i);
+ }
+
const kp = Keypair.generate();
const addr = kp.publicKey.toBase58();
@@ -111,10 +133,5 @@ export async function grindMintKeypair({
return { keypair: kp, iterations: i, durationMs: Date.now() - start };
}
- throw Object.assign(
- new Error(
- `vanity ${prefix ? `prefix '${prefix}'` : ''}${prefix && suffix ? ' + ' : ''}${suffix ? `suffix '${suffix}'` : ''} not found in ${maxIterations} attempts (estimated ~${Math.round(estimateAttempts({ prefix, suffix, ignoreCase })).toLocaleString()})`,
- ),
- { status: 504, code: 'vanity_timeout' },
- );
+ throw timeout(maxIterations);
}
diff --git a/api/_lib/solana/connection.js b/api/_lib/solana/connection.js
index eaead7471..59663c42a 100644
--- a/api/_lib/solana/connection.js
+++ b/api/_lib/solana/connection.js
@@ -21,6 +21,33 @@ function deriveWsUrl(httpUrl) {
return String(httpUrl).replace(/^https:/, 'wss:').replace(/^http:/, 'ws:');
}
+// Repair known-bad RPC hostnames sourced from env before they enter the endpoint
+// list. Helius's JSON-RPC host is `mainnet.helius-rpc.com` / `devnet.helius-rpc.com`;
+// a recurring prod misconfiguration set SOLANA_RPC_URL to `api-mainnet.helius-rpc.com`
+// (conflating the RPC host with the `api.helius.xyz` REST host), which 404s every
+// request and gets parked in a 30m cooldown forever. Rewriting the host turns a
+// perpetually-dead primary into a working endpoint instead of relying on failover
+// to silently route around it on every cold start. Unrecognized URLs pass through
+// untouched.
+export function normalizeRpcUrl(raw) {
+ const v = (raw ?? '').trim();
+ if (!v) return v;
+ try {
+ const u = new URL(v);
+ const fixedHost = u.hostname.replace(
+ /^api-(mainnet|devnet)\.helius-rpc\.com$/i,
+ '$1.helius-rpc.com',
+ );
+ if (fixedHost !== u.hostname) {
+ u.hostname = fixedHost;
+ return u.toString();
+ }
+ return v;
+ } catch {
+ return v;
+ }
+}
+
// Cooldown durations by failure class. Quota exhaustion (e.g. Helius -32429
// "max usage reached") means the provider is dead for the billing window, so we
// park it for hours instead of re-hammering it on every RPC call and every cron
@@ -95,16 +122,16 @@ export function solanaRpcEndpoints(network = 'mainnet', url = null) {
const ankr = process.env.ANKR_API_KEY;
if (network === 'devnet') {
return dedupe([
- url,
- process.env.SOLANA_RPC_URL_DEVNET,
+ normalizeRpcUrl(url),
+ normalizeRpcUrl(process.env.SOLANA_RPC_URL_DEVNET),
key && `https://devnet.helius-rpc.com/?api-key=${key}`,
alch && `https://solana-devnet.g.alchemy.com/v2/${alch}`,
PUBLIC_DEVNET,
]);
}
return dedupe([
- url,
- process.env.SOLANA_RPC_URL,
+ normalizeRpcUrl(url),
+ normalizeRpcUrl(process.env.SOLANA_RPC_URL),
key && `https://mainnet.helius-rpc.com/?api-key=${key}`,
alch && `https://solana-mainnet.g.alchemy.com/v2/${alch}`,
// Ankr sunset keyless access — every keyless rpc.ankr.com/<chain> now 403s
diff --git a/api/_lib/solana/sdk-bridge.js b/api/_lib/solana/sdk-bridge.js
index 1a473242a..0461227bd 100644
--- a/api/_lib/solana/sdk-bridge.js
+++ b/api/_lib/solana/sdk-bridge.js
@@ -110,7 +110,9 @@ export async function getBuyQuote(connection, mint, solAmount) {
const impact = calculateBuyPriceImpact({ global, feeConfig, mintSupply, bondingCurve, solAmount: amount });
return { tokens, priceImpact: impact.impactBps / 100 };
} catch (err) {
- if (!isMissingAccount(err) && !isTransientRpc(err)) {
+ // A graduated coin (no curve) is an expected state — the trade handler
+ // re-prices off the AMM pool. Don't log it as a failure.
+ if (!err?.graduated && !isMissingAccount(err) && !isTransientRpc(err)) {
console.warn('[sdk-bridge] getBuyQuote failed: %s', String(err).slice(0, 120));
}
return null;
@@ -131,7 +133,8 @@ export async function getSellQuote(connection, mint, tokenAmount) {
const impact = calculateSellPriceImpact({ global, feeConfig, mintSupply, bondingCurve, tokenAmount: amount });
return { sol, priceImpact: impact.impactBps / 100 };
} catch (err) {
- if (!isMissingAccount(err) && !isTransientRpc(err)) {
+ // Graduated coins re-price off the AMM pool in the trade handler — expected.
+ if (!err?.graduated && !isMissingAccount(err) && !isTransientRpc(err)) {
console.warn('[sdk-bridge] getSellQuote failed: %s', String(err).slice(0, 120));
}
return null;
diff --git a/api/_mcp3d/text-to-image.js b/api/_mcp3d/text-to-image.js
index 0b33a9cc7..8019fa2b5 100644
--- a/api/_mcp3d/text-to-image.js
+++ b/api/_mcp3d/text-to-image.js
@@ -195,7 +195,10 @@ export async function textToImage(prompt, { aspectRatio = '1:1' } = {}) {
} catch (err) {
// Nothing downstream to fall through to → surface the NIM error.
if (!hasVertex && !token) throw err;
- console.error(`nim flux failed, falling back: ${err?.message}`);
+ // A handled degradation (Vertex/HF will serve the image), not a fault —
+ // warn so it doesn't read as an error in the logs like the rest of the
+ // free-first cascade.
+ console.warn(`nim flux failed, falling back: ${err?.message}`);
}
}
diff --git a/api/agents/solana-wallet.js b/api/agents/solana-wallet.js
index 098f60518..562133082 100644
--- a/api/agents/solana-wallet.js
+++ b/api/agents/solana-wallet.js
@@ -1021,6 +1021,9 @@ async function handleLimits(req, res, id) {
// up to 8 chars) and assigned via POST /api/agents/:id/solana { secret_key }.
const VANITY_MAX_CHARS = 3; // combined prefix+suffix length for server grind
const VANITY_MAX_ITERATIONS = 4_000_000;
+// Wall-clock grind budget. Kept under the function's 45s maxDuration (vercel.json)
+// with ~15s of headroom for the post-grind wallet sweep and response.
+const VANITY_GRIND_BUDGET_MS = 30_000;
// Move every asset (all SPL tokens + remaining SOL) from a custodial keypair to a
// destination address, reclaiming token-account rent. Two-phase so the final SOL
@@ -1190,7 +1193,10 @@ async function handleVanity(req, res, id) {
try {
const est = estimateAttempts({ prefix, suffix, ignoreCase });
const maxIterations = Math.min(VANITY_MAX_ITERATIONS, Math.max(200_000, Math.ceil(est * 25)));
- ground = await grindMintKeypair({ prefix, suffix, ignoreCase, maxIterations });
+ // Bail before the function's maxDuration (45s, see vercel.json) so the grind
+ // returns a clean `vanity_timeout` 504 instead of a hard runtime kill, and
+ // still leaves headroom to sweep the wallet to the new address afterward.
+ ground = await grindMintKeypair({ prefix, suffix, ignoreCase, maxIterations, maxMs: VANITY_GRIND_BUDGET_MS });
} catch (e) {
if (e?.code === 'vanity_timeout') {
return error(res, 504, 'vanity_timeout', 'could not find a matching address in time — try a shorter pattern or grind it in the browser at /vanity-wallet');
diff --git a/api/oracle/backtest.js b/api/oracle/backtest.js
index 17d1e923b..2ebd3550d 100644
--- a/api/oracle/backtest.js
+++ b/api/oracle/backtest.js
@@ -56,7 +56,7 @@ async function query(days, tier, network) {
count(*) filter (where o.graduated)::int as graduated,
count(*) filter (where o.rugged)::int as rugged
from oracle_conviction c
- join pump_coin_outcomes o on o.mint = c.mint and o.network = c.network
+ join pump_coin_outcomes o on o.mint = c.mint
where c.network = ${network}
and (o.graduated or o.rugged or o.ath_multiple is not null)
${tierFilter}
@@ -86,7 +86,7 @@ async function query(days, tier, network) {
const top = await sql`
select c.mint, c.symbol, c.name, c.score, c.tier, o.ath_multiple, o.graduated, o.rugged
from oracle_conviction c
- join pump_coin_outcomes o on o.mint = c.mint and o.network = c.network
+ join pump_coin_outcomes o on o.mint = c.mint
where c.network = ${network}
and o.ath_multiple is not null
${topTierFilter}
diff --git a/api/oracle/stats.js b/api/oracle/stats.js
index 8990396b9..247cb5c5f 100644
--- a/api/oracle/stats.js
+++ b/api/oracle/stats.js
@@ -62,7 +62,7 @@ export default wrap(async (req, res) => {
count(*) filter (where o.ath_multiple >= 2 or o.graduated) as total_wins,
round(max(o.ath_multiple)::numeric, 2) as best_ath
from oracle_conviction c
- join pump_coin_outcomes o on o.mint = c.mint and o.network = c.network
+ join pump_coin_outcomes o on o.mint = c.mint
where c.network = ${network}
`.catch(() => [{}]),
diff --git a/api/oracle/wins.js b/api/oracle/wins.js
index 964be3386..d40a0c91f 100644
--- a/api/oracle/wins.js
+++ b/api/oracle/wins.js
@@ -81,7 +81,7 @@ export default wrap(async (req, res) => {
c.pedigree, c.structure, c.narrative, c.momentum, c.scored_at,
o.ath_multiple, o.last_market_cap_usd, o.graduated
from oracle_conviction c
- join pump_coin_outcomes o on o.mint = c.mint and o.network = c.network
+ join pump_coin_outcomes o on o.mint = c.mint
where c.network = ${network}
and o.ath_multiple >= ${minAth}
and (o.graduated or o.ath_multiple >= 2)
@@ -103,7 +103,7 @@ export default wrap(async (req, res) => {
round(max(o.ath_multiple)::numeric, 2) as best_ath,
count(*) filter (where o.graduated)::int as graduated_count
from oracle_conviction c
- join pump_coin_outcomes o on o.mint = c.mint and o.network = c.network
+ join pump_coin_outcomes o on o.mint = c.mint
where c.network = ${network}
and o.ath_multiple >= ${minAth}
and (o.graduated or o.ath_multiple >= 2)
diff --git a/api/x402-checkout.js b/api/x402-checkout.js
index 712fbef73..5193f4d2b 100644
--- a/api/x402-checkout.js
+++ b/api/x402-checkout.js
@@ -23,7 +23,6 @@
import { z } from 'zod';
import { solanaConnection } from './_lib/solana/connection.js';
import {
- Connection,
PublicKey,
TransactionMessage,
VersionedTransaction,
@@ -41,9 +40,12 @@ import { cors, json, method, readJson, wrap, error, rateLimited } from './_lib/h
import { parse } from './_lib/validate.js';
import { limits, clientIp } from './_lib/rate-limit.js';
import { NETWORK_SOLANA_MAINNET, NETWORK_SOLANA_DEVNET } from './_lib/x402-spec.js';
+import { env } from './_lib/env.js';
-const SOLANA_RPC = process.env.SOLANA_RPC_URL || 'https://api.mainnet-beta.solana.com';
-const SOLANA_DEVNET_RPC = process.env.SOLANA_RPC_URL_DEVNET || 'https://api.devnet.solana.com';
+// Routed through env.* so the `api-mainnet.helius-rpc.com` misconfig is repaired
+// (env.normalizeRpcUrl) — a bad host 404'd getAccountInfo on the USDC mint here.
+const SOLANA_RPC = env.SOLANA_RPC_URL;
+const SOLANA_DEVNET_RPC = env.SOLANA_RPC_URL_DEVNET;
// Short-lived caches so repeated prepare calls don't re-issue identical RPC
// round-trips. Mint decimals are effectively immutable; a blockhash is valid for
@@ -54,8 +56,23 @@ const BLOCKHASH_TTL_MS = 8 * 1000;
const mintDecimalsCache = new Map(); // `${rpc}:${mint}` -> { decimals, at }
const blockhashCache = new Map(); // rpc -> { blockhash, at }
+// Decimals for canonical mints are immutable and universally known. Resolving
+// them locally skips an RPC round-trip on the hot checkout path (USDC is the
+// default settlement asset) and immunizes prepare against a flaky/rate-limited
+// RPC returning 404 for getAccountInfo on the mint — the failure mode that
+// 500'd every USDC checkout when the public endpoint was cooling.
+const WELL_KNOWN_MINT_DECIMALS = new Map([
+ ['EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', 6], // USDC (mainnet)
+ ['Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB', 6], // USDT (mainnet)
+ ['So11111111111111111111111111111111111111112', 9], // wrapped SOL
+]);
+
async function getMintDecimals(conn, rpc, mint) {
- const key = `${rpc}:${mint.toBase58()}`;
+ const mintStr = mint.toBase58();
+ const known = WELL_KNOWN_MINT_DECIMALS.get(mintStr);
+ if (known != null) return known;
+
+ const key = `${rpc}:${mintStr}`;
const hit = mintDecimalsCache.get(key);
if (hit && Date.now() - hit.at < MINT_DECIMALS_TTL_MS) return hit.decimals;
const info = await getMint(conn, mint);
diff --git a/data/changelog.json b/data/changelog.json
index 6df6dc724..b23ac5644 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,32 @@
{
"$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-20",
+ "title": "Oracle “wins” and backtest now load instead of erroring",
+ "summary": "The Oracle's track-record views — the list of called coins that pumped or graduated, plus the per-tier backtest and stats — were failing to load because of an internal database mismatch. They now query correctly, so you can see the Oracle's real hit-rate, best multiples, and graduation counts across any time window and tier.",
+ "tags": [
+ "fix"
+ ],
+ "link": "/oracle"
+ },
+ {
+ "date": "2026-06-20",
+ "title": "Vanity wallet grinding fails gracefully instead of timing out",
+ "summary": "Generating a custom vanity address for an agent's wallet on the server could run past the request limit and return an unhelpful gateway timeout. It now stops cleanly within budget and tells you to grind longer patterns in the browser at /vanity-wallet (GPU-accelerated, up to 8 characters) — no more dead-end timeouts.",
+ "tags": [
+ "fix"
+ ],
+ "link": "/vanity-wallet"
+ },
+ {
+ "date": "2026-06-20",
+ "title": "Brain Studio no longer crashes when opening “How this brain behaves” early",
+ "summary": "In the agent Brain Studio, clicking “How this brain behaves” before the circuit canvas had finished loading could throw an error and leave the panel stuck. The behavior view now mounts the editor on demand, so it always opens — showing an empty-brain note if you haven't wired anything yet — instead of failing.",
+ "tags": [
+ "fix"
+ ]
+ },
{
"date": "2026-06-20",
"title": "Agents Index now shows every registered agent",
diff --git a/public/changelog.json b/public/changelog.json
index efafb10de..5db41d839 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-20T09:10:12.556Z",
+ "generated_at": "2026-06-20T12:01:11.783Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -56,6 +56,16 @@
"fix"
]
},
+ {
+ "date": "2026-06-20",
+ "type": "update",
+ "title": "Brain Studio no longer crashes when opening “How this brain behaves” early",
+ "summary": "In the agent Brain Studio, clicking “How this brain behaves” before the circuit canvas had finished loading could throw an error and leave the panel stuck. The behavior view now mounts the editor on demand, so it always opens — showing an empty-brain note if you haven't wired anything yet — instead of failing.",
+ "link": null,
+ "tags": [
+ "fix"
+ ]
+ },
{
"date": "2026-06-20",
"type": "update",
@@ -159,6 +169,16 @@
"fix"
]
},
+ {
+ "date": "2026-06-20",
+ "type": "update",
+ "title": "Oracle “wins” and backtest now load instead of erroring",
+ "summary": "The Oracle's track-record views — the list of called coins that pumped or graduated, plus the per-tier backtest and stats — were failing to load because of an internal database mismatch. They now query correctly, so you can see the Oracle's real hit-rate, best multiples, and graduation counts across any time window and tier.",
+ "link": "/oracle",
+ "tags": [
+ "fix"
+ ]
+ },
{
"date": "2026-06-20",
"type": "update",
@@ -253,6 +273,16 @@
"fix"
]
},
+ {
+ "date": "2026-06-20",
+ "type": "update",
+ "title": "Vanity wallet grinding fails gracefully instead of timing out",
+ "summary": "Generating a custom vanity address for an agent's wallet on the server could run past the request limit and return an unhelpful gateway timeout. It now stops cleanly within budget and tells you to grind longer patterns in the browser at /vanity-wallet (GPU-accelerated, up to 8 characters) — no more dead-end timeouts.",
+ "link": "/vanity-wallet",
+ "tags": [
+ "fix"
+ ]
+ },
{
"date": "2026-06-20",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index 9ef4b72f3..785e5a525 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -46,6 +46,14 @@
<category>fix</category>
<description>The Agents Index at /agents was reading from an empty source and showed &quot;No public agents yet&quot; even though hundreds of agents are registered across chains. It now reads from the live on-chain registry — the same feed Discover uses — so you can browse every registered agent, search them, see their services and x402 support, and open any one's detail page. Search, sorting and load-more all work against the real directory.</description>
</item>
+ <item>
+ <title>Brain Studio no longer crashes when opening “How this brain behaves” early</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-06-20:Brain Studio no longer crashes when opening “How this brain behaves” early</guid>
+ <pubDate>Sat, 20 Jun 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>In the agent Brain Studio, clicking “How this brain behaves” before the circuit canvas had finished loading could throw an error and leave the panel stuck. The behavior view now mounts the editor on demand, so it always opens — showing an empty-brain note if you haven't wired anything yet — instead of failing.</description>
+ </item>
<item>
<title>Choose where you walk — six environments for the Walk page</title>
<link>https://three.ws/features/walk</link>
@@ -126,6 +134,14 @@
<category>fix</category>
<description>The background job that records agents' on-chain milestones — token graduations, fee claims, whale trades — had stopped running because it could only read its signing key in one specific format. Now it accepts the key in any standard Solana format, so those reputation events post to the chain again, and a misconfigured key skips cleanly instead of taking the whole monitor down.</description>
</item>
+ <item>
+ <title>Oracle “wins” and backtest now load instead of erroring</title>
+ <link>https://three.ws/oracle</link>
+ <guid isPermaLink="false">2026-06-20:Oracle “wins” and backtest now load instead of erroring</guid>
+ <pubDate>Sat, 20 Jun 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>The Oracle's track-record views — the list of called coins that pumped or graduated, plus the per-tier backtest and stats — were failing to load because of an internal database mismatch. They now query correctly, so you can see the Oracle's real hit-rate, best multiples, and graduation counts across any time window and tier.</description>
+ </item>
<item>
<title>Pick and switch avatars from the Walk Avatar extension popup</title>
<link>https://three.ws/changelog</link>
@@ -198,6 +214,14 @@
<category>fix</category>
<description>Two crashes are fixed. Your account's transaction history — every skill purchase and sale — was failing to load because of a database column mismatch; it now reads each payment's token decimals from the price record and renders the full ledger correctly. And in the agent Brain Studio, closing the 'How this brain behaves' preview before the circuit canvas had finished loading could throw an error; the editor now closes cleanly no matter when you dismiss it.</description>
</item>
+ <item>
+ <title>Vanity wallet grinding fails gracefully instead of timing out</title>
+ <link>https://three.ws/vanity-wallet</link>
+ <guid isPermaLink="false">2026-06-20:Vanity wallet grinding fails gracefully instead of timing out</guid>
+ <pubDate>Sat, 20 Jun 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>Generating a custom vanity address for an agent's wallet on the server could run past the request limit and return an unhelpful gateway timeout. It now stops cleanly within budget and tells you to grind longer patterns in the browser at /vanity-wallet (GPU-accelerated, up to 8 characters) — no more dead-end timeouts.</description>
+ </item>
<item>
<title>Walk Avatar browser extension — Chrome Web Store release package</title>
<link>https://three.ws/extension/privacy</link>
diff --git a/public/features.json b/public/features.json
index 07bb10ca1..162dce7ba 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-20T09:10:12.540Z",
+ "generated_at": "2026-06-20T12:01:11.771Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
diff --git a/src/avatar-gallery-picker.js b/src/avatar-gallery-picker.js
index fcb82fe26..06adf1cc5 100644
--- a/src/avatar-gallery-picker.js
+++ b/src/avatar-gallery-picker.js
@@ -110,6 +110,7 @@ export class AvatarGalleryPicker {
openModal() {
if (this._overlay) return;
+ this._closed = false;
ensureModelViewer();
this._overlay = document.createElement('div');
@@ -132,6 +133,7 @@ export class AvatarGalleryPicker {
}
mountInline(container) {
+ this._closed = false;
ensureModelViewer();
this._shell = this._buildShell();
this._shell.classList.add('agp-shell--inline');
@@ -142,15 +144,25 @@ export class AvatarGalleryPicker {
}
close() {
+ // Idempotent: a fast close→navigate (e.g. the /pose page tears the picker
+ // down while a backdrop-dismiss is mid-flight) can call close() twice. We
+ // null the instance fields synchronously and operate on captured locals so
+ // the deferred overlay removal never dereferences a node a prior call
+ // already detached (TypeError: ... reading 'remove' on null).
+ if (this._closed) return;
+ this._closed = true;
if (this._io) { this._io.disconnect(); this._io = null; }
document.removeEventListener('keydown', this._onKey);
- if (this._overlay) {
- this._overlay.classList.remove('agp-open');
- setTimeout(() => { this._overlay.remove(); this._overlay = null; }, 200);
- } else if (this._shell) {
- this._shell.remove();
- }
+ const overlay = this._overlay;
+ const shell = this._shell;
+ this._overlay = null;
this._shell = null;
+ if (overlay) {
+ overlay.classList.remove('agp-open');
+ setTimeout(() => overlay.remove(), 200);
+ } else if (shell) {
+ shell.remove();
+ }
this.opts.onClose();
}
diff --git a/src/studio/brain/brain-studio.js b/src/studio/brain/brain-studio.js
index b712b1e58..d6c27e094 100644
--- a/src/studio/brain/brain-studio.js
+++ b/src/studio/brain/brain-studio.js
@@ -361,6 +361,13 @@ class BrainStudio {
// Show how the current circuit compiles to behavior, and diff it against the
// last-saved brain so a user sees exactly how an edit changes the agent.
_showBehavior() {
+ // The brain canvas mounts lazily (see _showEditor), so #bsDiff can be
+ // clicked before this.graph exists — e.g. during the async provider fetch
+ // in _init, or a stray click while onboarding is still showing. Lazily
+ // mount the editor first so there's always a graph to compile; an empty
+ // graph renders the "(empty — wire a Persona node)" diff rather than
+ // throwing "undefined is not an object (evaluating 'this.graph.toGraph')".
+ if (!this.graph) this._showEditor();
const current = compileBrain(this.graph.toGraph(), { agentName: this.studio.agent?.name });
const prev = this._savedPersona;
const card = this.el.querySelector('#bsModalCard');
diff --git a/tests/oracle/outcomes-join.test.js b/tests/oracle/outcomes-join.test.js
new file mode 100644
index 000000000..28264d0d2
--- /dev/null
+++ b/tests/oracle/outcomes-join.test.js
@@ -0,0 +1,38 @@
+// Regression guard for a production 500: the oracle endpoints used to join
+// `pump_coin_outcomes o` on `o.mint = c.mint AND o.network = c.network`, but
+// `pump_coin_outcomes` has no `network` column (its primary key is `mint`
+// alone, which already references pump_coin_intel(mint) 1:1). That broke every
+// /api/oracle/wins, /backtest, and /stats request with
+// `column o.network does not exist`. The network filter is enforced upstream by
+// `where c.network = $1` on oracle_conviction, so the outcomes join must key on
+// mint only. This test pins that — any reintroduction of `o.network` in a
+// pump_coin_outcomes join fails here instead of in production.
+
+import { describe, it, expect } from 'vitest';
+import { readFileSync } from 'node:fs';
+import { fileURLToPath } from 'node:url';
+import { dirname, join } from 'node:path';
+
+const ROOT = join(dirname(fileURLToPath(import.meta.url)), '..', '..');
+
+const FILES = [
+ 'api/oracle/wins.js',
+ 'api/oracle/backtest.js',
+ 'api/oracle/stats.js',
+];
+
+describe('pump_coin_outcomes join keys on mint only', () => {
+ for (const rel of FILES) {
+ it(`${rel} does not join pump_coin_outcomes on a nonexistent network column`, () => {
+ const src = readFileSync(join(ROOT, rel), 'utf8');
+ // Find every "join pump_coin_outcomes <alias> on ..." clause up to the
+ // line break and assert none of them reference "<alias>.network".
+ const joins = src.match(/join\s+pump_coin_outcomes\s+(\w+)\s+on[^\n]*/gi) || [];
+ expect(joins.length).toBeGreaterThan(0);
+ for (const clause of joins) {
+ const alias = clause.match(/pump_coin_outcomes\s+(\w+)/i)[1];
+ expect(clause).not.toMatch(new RegExp(`\\b${alias}\\.network\\b`));
+ }
+ });
+ }
+});
diff --git a/vercel.json b/vercel.json
index d9414a1ab..d5c339bf9 100644
--- a/vercel.json
+++ b/vercel.json
@@ -9,6 +9,9 @@
"api/cron/copy-fanout.js": {
"maxDuration": 120
},
+ "api/agents/[id].js": {
+ "maxDuration": 45
+ },
"api/club/tips-stream.js": {
"includeFiles": "{examples/skills/**,data/pages.json,data/archives/**,data/rss/**,data/_generated/**,sdk/src/sas-config.json}",
"maxDuration": 300