feat(bot): suppress bot retry-search churn from the moderator log

Pop intermediate wont_help/illegal_move/no_such_piece/no_legal_moves
announcements produced during the bot's decision cycle before any
broadcast reaches the human opponent.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
claude (blind_chess)
2026-05-18 20:00:25 -04:00
parent 76717cf52e
commit 558891ed37
2 changed files with 28 additions and 0 deletions
+10
View File
@@ -165,6 +165,16 @@ export class BotDriver {
const text = result.announcements[0]!.text;
if (text === 'wont_help' || text === 'illegal_move'
|| text === 'no_such_piece' || text === 'no_legal_moves') {
// Attempted-move announcements are audience 'both'. The bot's
// intermediate retry rejections are internal search churn, not
// deliberate probing — suppress them so they don't broadcast to
// the human. The bot tracks its own rejections via attemptHistory,
// so removing the announcement is safe. The whole decision cycle
// runs before ws.ts broadcasts, so this pop always happens before
// any broadcast.
const rejection = result.announcements[0]!;
const anns = this.game.announcements;
if (anns[anns.length - 1] === rejection) anns.pop();
return {
kind: 'retry',
entry: {