online-go / gtp2ogs

GTP Wrapper to allow bots to interface with the Online-Go.com Server
MIT License
88 stars 29 forks source link

move silently fails to send #417

Open raylu opened 7 months ago

raylu commented 7 months ago

my bot crashed during this game https://online-go.com/game/62948925. here are the last bit of logs

Mar 30 08:13:35   Game.ts:581          [game 62948925] Playing h2 { x: 7, y: 7, text: 'h2', resign: false, pass: false }
Mar 30 08:13:38   Game.ts:249          [game 62948925] Opponent played j3
Mar 30 08:13:38   Game.ts:446          [game 62948925] Acquiring main bot instance
Mar 30 08:13:38   Game.ts:456          [bot  2377:3481078] [game 62948925] Acquired bot instance
Mar 30 08:13:38   Game.ts:511          [bot  2377:3481078] Generating move for game 62948925
Mar 30 08:13:38   Game.ts:512          [game 62948925] genmove white
Mar 30 08:13:39   Game.ts:369          [game 62948925] Releasing bot(s)
Mar 30 08:13:39   Game.ts:625          [game 62948925] Min move time was  1500 ms and we only took  510 ms. Waiting  990 ms before sending move
Mar 30 08:13:40   Game.ts:581          [game 62948925] Playing j2 { x: 8, y: 7, text: 'j2', resign: false, pass: false }
Mar 30 08:13:40   Game.ts:249          [game 62948925] Opponent played h4
Mar 30 08:13:40   Game.ts:446          [game 62948925] Acquiring main bot instance
Mar 30 08:13:40   Game.ts:456          [bot  2377:3481078] [game 62948925] Acquired bot instance
Mar 30 08:13:40   Game.ts:511          [bot  2377:3481078] Generating move for game 62948925
Mar 30 08:13:40   Game.ts:512          [game 62948925] genmove white
Mar 30 08:13:41   Game.ts:369          [game 62948925] Releasing bot(s)
Mar 30 08:13:41   Game.ts:625          [game 62948925] Min move time was  1500 ms and we only took  568 ms. Waiting  932 ms before sending move
Mar 30 08:13:42   Game.ts:581          [game 62948925] Playing h8 { x: 7, y: 1, text: 'h8', resign: false, pass: false }
Mar 30 08:14:12   Game.ts:136          [game 62948925] gamedata     W   𝖌𝖔 𝖕𝖗𝖔66  [9x9]
Mar 30 08:14:12   Game.ts:446          [game 62948925] Acquiring main bot instance
Mar 30 08:14:12   Game.ts:456          [bot  2377:3481078] [game 62948925] Acquired bot instance
Mar 30 08:14:12   Game.ts:511          [bot  2377:3481078] Generating move for game 62948925
Mar 30 08:14:12   Game.ts:512          [game 62948925] genmove white

so you can see we recognized the Opponent played h4 and then we logged Playing h8. but the last move OGS has is h4

the next line in my logfile is my bot crashing because it asserts that it's black's turn

my diagnosis is that we call https://github.com/online-go/gtp2ogs/blob/9478fd1c808dcb23fbc6c6d6c5d6b1f7a5a07e62/src/Game.ts#L585 which just calls https://github.com/online-go/goban/blob/311bdb5b4e1b62524d26e945c00602effa8dc9bb/src/GobanSocket.ts#L352 with no cb we should instead send a callback with an error handler, possibly via GobanSocket.sendPromise

I suspect this might be the same cause as #409