From cb8e017792dc4c716c40d76a29f64d27fa5d8b88 Mon Sep 17 00:00:00 2001 From: "claude (blind_chess)" Date: Tue, 28 Apr 2026 14:22:41 -0400 Subject: [PATCH] fix(bot): wire aiOpponent into joined and update server messages --- packages/server/src/ws.ts | 2 ++ packages/server/test/integration/ai-game-casual.test.ts | 3 +++ 2 files changed, 5 insertions(+) diff --git a/packages/server/src/ws.ts b/packages/server/src/ws.ts index 9ef0dcb..3c1a167 100644 --- a/packages/server/src/ws.ts +++ b/packages/server/src/ws.ts @@ -147,6 +147,7 @@ async function onHello(ctx: SocketCtx, msg: Extract { human.send({ type: 'hello', gameId, token: creatorToken }); const joined = await human.waitFor((m) => m.type === 'joined'); expect(joined.type === 'joined' && joined.you).toBe('b'); + if (joined.type === 'joined') { + expect(joined.aiOpponent).toEqual({ color: 'w', brain: 'casual' }); + } // Bot's opening move should arrive as an update (bot moves first as white). const botMoved = await human.waitFor((m) =>