From 063cd2a78ca3c1c219309aa9b16f98bb2bff88a9 Mon Sep 17 00:00:00 2001 From: Eric Wagoner Date: Wed, 26 Aug 2026 10:43:42 -0400 Subject: [PATCH] The seat file follows the join, not the ghost MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Joining a new room while an old seat file lingered kept the OLD room id beside the NEW room's token — orphaning the fresh seat as an unkickable lobby ghost the moment the file was cleared. A join now records the room it actually joined; only resumes inherit the file. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_015RCWSTnb1KYTPyL4GmhGnF --- tools/claude-seat.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/claude-seat.mjs b/tools/claude-seat.mjs index e5a74e2..2fd3ec0 100644 --- a/tools/claude-seat.mjs +++ b/tools/claude-seat.mjs @@ -101,7 +101,8 @@ ws.on("message", (raw) => { const msg = JSON.parse(raw.toString()); if (msg.type === "error") die(`SERVER: ${msg.message}`); if (msg.type === "seat") { - const s = { roomId: seat?.roomId ?? args[0]?.toUpperCase(), name: msg.playerId, token: msg.token }; + // A join names its room explicitly; only a resume inherits the file's. + const s = { roomId: verb === "join" ? args[0].toUpperCase() : seat.roomId, name: msg.playerId, token: msg.token }; writeFileSync(SEAT_FILE, JSON.stringify(s)); if (verb === "join") { console.log(`seated as ${msg.playerId} in ${s.roomId}`); afterJoin(); } }