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.

fix: improve production Redis configuration warning and update test environment variables

nrpod74b576eef82
diff --git a/api/_lib/rate-limit.js b/api/_lib/rate-limit.js
index b43d243d7..e66fbedfd 100644
--- a/api/_lib/rate-limit.js
+++ b/api/_lib/rate-limit.js
@@ -23,8 +23,11 @@ const FORGE_PAID_GLOBAL_HOURLY = Math.max(1, Number(process.env.FORGE_PAID_GLOBA
// Loud, one-time startup warning when Redis is unconfigured in production. Without
// Redis every limiter falls back to a PER-INSTANCE in-memory map, which is
// effectively unbounded across serverless fan-out — fine for dev, dangerous for
-// the money/cost limiters in prod (see failClosedLimiter below).
-if (IS_PRODUCTION && !REDIS_CONFIGURED) {
+// the money/cost limiters in prod (see failClosedLimiter below). Suppressed under
+// vitest: the Vercel build inherits VERCEL_ENV=production while running the test
+// gate, which made this fire as scary-but-meaningless build-log noise. Fail-closed
+// behavior itself is NOT gated on VITEST — tests exercise it deliberately.
+if (IS_PRODUCTION && !REDIS_CONFIGURED && !process.env.VITEST) {
console.error(
'[rate-limit] FATAL CONFIG: UPSTASH_REDIS_REST_URL/TOKEN are unset in production. ' +
'Cost/money-moving limiters will FAIL CLOSED (deny) until Redis is configured; ' +
diff --git a/chat/package-lock.json b/chat/package-lock.json
index 41f1f6b75..858c3c0f2 100644
--- a/chat/package-lock.json
+++ b/chat/package-lock.json
@@ -1296,9 +1296,9 @@
}
},
"node_modules/caniuse-lite": {
- "version": "1.0.30001702",
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001702.tgz",
- "integrity": "sha512-LoPe/D7zioC0REI5W73PeR1e1MLCipRGq/VkovJnd6Df+QVqT+vT33OXCp8QUd7kA7RZrHWxb1B36OQKI/0gOA==",
+ "version": "1.0.30001800",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001800.tgz",
+ "integrity": "sha512-MMHtuAz9Ys840zAY5F4k6fV5GaivZ9sPk+nz0mY+GYVzRBnYkN0mpqkSR92oWRQ19yQWo4HvBV/FnC16AJX8MA==",
"dev": true,
"funding": [
{
diff --git a/tests/api/auth-hints.test.js b/tests/api/auth-hints.test.js
index 6bf17ac9d..ae8a86461 100644
--- a/tests/api/auth-hints.test.js
+++ b/tests/api/auth-hints.test.js
@@ -311,6 +311,10 @@ describe('paidEndpoint authHints integration', () => {
process.env.X402_PAY_TO_BASE = '0x209693Bc6afc0C5328bA36FaF03C514EF312287C';
process.env.X402_ASSET_ADDRESS_BASE = '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913';
process.env.X402_MAX_AMOUNT_REQUIRED = '10000';
+ // Base accepts are gated on baseSettleable() — pay-to + asset alone no longer
+ // advertise the network (see buildRequirements in x402-paid-endpoint.js).
+ // Opt in explicitly, else every request here 500s with no_payto_configured.
+ process.env.X402_ADVERTISE_BASE = 'true';
({ paidEndpoint } = await import('../../api/_lib/x402-paid-endpoint.js'));
({ mintAccessToken: mintAccessTokenFn } = await import('../../api/_lib/auth.js'));
});
diff --git a/tests/api/three-token-leaderboard.test.js b/tests/api/three-token-leaderboard.test.js
index 347d63120..bf6637090 100644
--- a/tests/api/three-token-leaderboard.test.js
+++ b/tests/api/three-token-leaderboard.test.js
@@ -100,6 +100,10 @@ describe('GET /api/three-token/leaderboard', () => {
it('degrades to an empty board (200, not 500) when Helius fails', async () => {
threeHolderBalances.mockRejectedValueOnce(new Error('helius unconfigured'));
+ // Market data must still return a promise — a bare vi.fn() returns undefined,
+ // and `.catch` on undefined throws a TypeError that would trip the degrade
+ // path for the wrong reason (masking whether the Helius rejection is handled).
+ fetchTokenMarketData.mockResolvedValueOnce(null);
const res = makeRes();
await handler(makeReq({ url: '/api/three-token/leaderboard' }), res);
expect(res.statusCode).toBe(200);