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(play): tighten the souvenir e2e check and event-souvenir edge case

nirholas581ea4e3fbff
diff --git a/scripts/play-souvenir-e2e.mjs b/scripts/play-souvenir-e2e.mjs
index e2f9ed43f..08f96ca1e 100644
--- a/scripts/play-souvenir-e2e.mjs
+++ b/scripts/play-souvenir-e2e.mjs
@@ -18,7 +18,12 @@
// opened and closed between phases of one run. Point the game server at it with
// EVENT_CONFIG_URL, see below.
//
-// Requires vite on :3000 and colyseus on :2567 with the config override:
+// Both servers run on PRIVATE ports, and the browser is pointed at the game
+// server with window.GAME_SERVER_URL. This machine routinely has several agents'
+// Vite instances and load tests running at once, and an earlier run on the
+// conventional :3000/:2567 pair ended up sharing its world with another job's
+// synthetic clients: hundreds of unrelated joins, seat reservations expiring,
+// and no trustworthy read on anything.
//
// node scripts/play-souvenir-e2e.mjs # boots both servers itself
// EXTERNAL=1 node scripts/play-souvenir-e2e.mjs # you started them yourself
@@ -32,7 +37,12 @@ import { resolve, dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..');
-const BASE = (process.env.BASE || 'http://localhost:3000').replace(/\/$/, '');
+// Private ports by default, so a neighbouring agent's dev server or load test
+// can neither serve this run's pages nor join this run's world.
+const VITE_PORT = Number(process.env.VITE_PORT || 3111);
+const MP_PORT = Number(process.env.MP_PORT || 2571);
+const BASE = (process.env.BASE || `http://localhost:${VITE_PORT}`).replace(/\/$/, '');
+const GAME_SERVER = process.env.GAME_SERVER || `ws://127.0.0.1:${MP_PORT}`;
const MINT = process.env.COIN || 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump';
const WORLD = `${BASE}/play?coin=${encodeURIComponent(MINT)}&name=three.ws&symbol=three`;
const SOUVENIR_ID = 'laurel-meetup';
diff --git a/src/game/event-souvenir.js b/src/game/event-souvenir.js
index bff7c2fb1..e600217d6 100644
--- a/src/game/event-souvenir.js
+++ b/src/game/event-souvenir.js
@@ -15,7 +15,7 @@
//
// Rendering reads the shared catalog, so the card shows the item's real poster
// and name rather than re-describing it (an event that swaps its souvenir needs
-// no change here.
+// no change here).
import { getCosmetic } from '../../multiplayer/src/cosmetics-catalog.js';