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.

docs(page-agent): make the rig-verification sample actually run

nirholas0f5e86db19e9
diff --git a/api/_lib/solana/connection.js b/api/_lib/solana/connection.js
index f599d3ea3..eb4608cc1 100644
--- a/api/_lib/solana/connection.js
+++ b/api/_lib/solana/connection.js
@@ -343,6 +343,16 @@ function publishCooldowns(now) {
.catch(() => {});
}
+// A provider refusing one call shape (a blocked method, an unsupported filter, an
+// unindexed account key) rather than the caller. Endpoint-scoped credentials are
+// not the problem, so the lane must survive the refusal; only this request fails
+// over. Kept separate from isProviderTierError, which matches paid-plan gating.
+function isBlockedCallShape(bodyText) {
+ return /request blocked|blocked parameter|excluded from account secondary indexes|method .*(not supported|is not available|disabled)/i.test(
+ bodyText || '',
+ );
+}
+
function cooldownMsFor(status, bodyText) {
if (status === 429) {
// "request limit reached" / -32003 is how QuickNode signals a DAILY cap
@@ -362,6 +372,16 @@ function cooldownMsFor(status, bodyText) {
? QUOTA_COOLDOWN_MS
: RATE_LIMIT_COOLDOWN_MS;
}
+ // A 403 normally means a bad/expired key, which is an endpoint-wide problem.
+ // Some keyless nodes instead answer 403 to refuse ONE call shape while serving
+ // everything else: PublicNode returns `{"code":-32602,"Request blocked.
+ // Details: blocked parameter: params.1.programId"}` for getTokenAccountsByOwner
+ // filtered by programId, a call the token/USDC balance readers make constantly.
+ // Treated as an auth failure that parked the whole node for 30m, so a healthy
+ // primary was evicted by its own routine traffic and the rotation cascaded onto
+ // the exhausted paid lanes. The endpoint is fine, this one request is not: fail
+ // over for the call, keep the lane.
+ if (status === 403 && isBlockedCallShape(bodyText)) return NETWORK_COOLDOWN_MS;
if (status === 401 || status === 403) return AUTH_COOLDOWN_MS;
// 404/410: the endpoint URL is dead or misrouted (expired Quicknode/Alchemy
// app, wrong path) — a persistent misconfiguration, so park it like an auth
@@ -617,9 +637,28 @@ const PROVIDER_CAPACITY_CODES = new Set([
// surfaced straight to the caller and blinded every getSignaturesForAddress
// consumer (the ring leak scanner) and every getBalance consumer the moment the
// rotation cascaded past the keyed lanes onto Tatum.
+// A keyless lane can also refuse a method by POLICY rather than by tier, and the
+// dangerous variant answers HTTP 200 so no status-driven rotation fires. Measured
+// on the live free lanes 2026-07-30:
+// • PublicNode getProgramAccounts → 200 + {code:-32010, "… excluded from account
+// secondary indexes; this RPC method unavailable for key"}
+// • PublicNode getTokenAccountsByOwner → {code:-32602, "Request blocked.
+// Details: blocked parameter: params.1.programId"}, a -32602 that is NOT
+// invalid params, so the code alone would wrongly read as deterministic
+// • MagicBlock getProgramAccounts → {code:403, "Your IP or provider is blocked
+// from this endpoint"}
+// All three are provider-specific: another lane serves the same call normally, so
+// rotating is correct. Unclassified, the 200-status one surfaced straight to the
+// caller and hard-failed the $THREE holder-gating and token-balance readers
+// (api/_lib/balances.js, api/_lib/coin/holders.js, api/_lib/embed-gate.js,
+// api/scene/gate-check.js) whenever the rotation was sitting on that lane.
+const PROVIDER_POLICY_BLOCK = /excluded from account secondary indexes|this rpc method unavailable|request blocked|blocked parameter|blocked from this endpoint/i;
+
function isProviderTierError(rpcError) {
+ const message = String(rpcError?.message || '');
+ if (PROVIDER_POLICY_BLOCK.test(message)) return true;
return /not available for anonymous access|available for paid plans only|upgrade your subscription|please register at/i.test(
- String(rpcError?.message || ''),
+ message,
);
}
diff --git a/page-agent-sdk/docs/guide-custom-avatars.md b/page-agent-sdk/docs/guide-custom-avatars.md
index 86cf363bf..068bf4d7e 100644
--- a/page-agent-sdk/docs/guide-custom-avatars.md
+++ b/page-agent-sdk/docs/guide-custom-avatars.md
@@ -106,9 +106,16 @@ tells you which lipsync tier your model qualifies for:
```js
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
+import { MeshoptDecoder } from 'three/addons/libs/meshopt_decoder.module.js';
import { buildMorphMap } from '@three-ws/page-agent';
-const gltf = await new GLTFLoader().loadAsync('https://three.ws/avatars/realistic-halfbody.glb');
+// Every rig in the three.ws catalog carries EXT_meshopt_compression, and
+// GLTFLoader throws without a decoder. `AvatarStage` wires this for you; a
+// standalone loader has to do it itself.
+const loader = new GLTFLoader();
+loader.setMeshoptDecoder(MeshoptDecoder);
+
+const gltf = await loader.loadAsync('https://three.ws/avatars/realistic-halfbody.glb');
const morph = buildMorphMap(gltf.scene);
console.log('lipsync tier:', morph?.mode ?? 'animation (no face morphs)');
diff --git a/tests/solana-rpc-priority-and-breaker.test.js b/tests/solana-rpc-priority-and-breaker.test.js
index b3aa3bf4c..7688a32bf 100644
--- a/tests/solana-rpc-priority-and-breaker.test.js
+++ b/tests/solana-rpc-priority-and-breaker.test.js
@@ -165,6 +165,32 @@ describe('endpoint breaker — quota verdicts are shared fleet-wide', () => {
).toBeNull();
});
+ it.each([
+ // Measured on the live free lanes 2026-07-30. The first is the dangerous one:
+ // HTTP 200, so nothing rotates on status, and code -32010 is not a capacity
+ // code, so it reached $THREE holder-gating callers as a hard error.
+ ['PublicNode getProgramAccounts (200)', { code: -32010, message: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA excluded from account secondary indexes; this RPC method unavailable for key' }],
+ ['PublicNode getTokenAccountsByOwner', { code: -32602, message: 'Request blocked. Details: blocked parameter: params.1.programId' }],
+ ['MagicBlock IP block', { code: 403, message: 'Your IP or provider is blocked from this endpoint' }],
+ ])('rotates past a provider POLICY block: %s', (_label, error) => {
+ expect(classifyRpcBody(JSON.stringify({ jsonrpc: '2.0', id: 1, error }))).toBeTruthy();
+ });
+
+ it('still refuses to rotate on a genuine invalid-params error', () => {
+ // -32602 is shared between "you sent bad params" (deterministic, every lane
+ // fails it) and PublicNode's policy block above. Only the phrasing separates
+ // them, so the genuine case must stay non-rotating.
+ expect(
+ classifyRpcBody(
+ JSON.stringify({
+ jsonrpc: '2.0',
+ id: 1,
+ error: { code: -32602, message: 'Invalid param: WrongSize' },
+ }),
+ ),
+ ).toBeNull();
+ });
+
it('hydrate() adopts a sibling verdict for an endpoint this instance never tried', async () => {
const unseen = 'https://never-tried-here.example/rpc';
expect(isEndpointCooling(unseen)).toBe(false);