Describe the bug
lichess-bot bots can't handle FRC FromPosition games, will receive wrong castling rights from the server, and error out after the opponent castles "illegally". https://lichess.org/rQA6AjkX as an example.
To Reproduce
Steps to reproduce the behavior:
- Challenge a lichess-bot who accepts arbitrary
FromPosition challenges to a position with FRC castling rights included, like rbqnkrbn/pppppppp/8/8/8/8/PPPPPPPP/RBQ1KRBN w AFaf - 0 1
- Castle by capturing your own rook
- Bot errors out because it can't set up the correct position and will time out.
Expected behavior
https://github.com/lichess-bot-devs/lichess-bot/blob/master/lib/lichess_bot.py#L832-L835
This should also set the mode to chess960=True if it's a "From Position" but with FRC castling rights. However, a quick test shows that game.initial_fen seems to have standard castling rights, so this might require some additional logic.
Logs
Throws a uci move when handling the FRC castling:
line 3147, in parse_uci
raise IllegalMoveError(f"illegal uci: {uci!r} in {self.fen()}")
chess.IllegalMoveError: illegal uci: 'e8f8' in
rbqnkr1n/ppppp1pp/4b3/5p2/2P2P2/2Q5/PP1PP1PP/RB2KRBN b Qq - 2 3
[10/10/25 09:36:18] ERROR Ignoring illegal move e8f8 on board
started from rbqnkrb
Desktop (please complete the following information):
- OS: [e.g. Windows]
- Python Version: [e.g. 3.11]
- Terminal: [e.g. Command Line, PowerShell]
Additional context
Add any other context about the problem here.
Describe the bug
lichess-botbots can't handle FRC FromPosition games, will receive wrong castling rights from the server, and error out after the opponent castles "illegally". https://lichess.org/rQA6AjkX as an example.To Reproduce
Steps to reproduce the behavior:
FromPositionchallenges to a position with FRC castling rights included, likerbqnkrbn/pppppppp/8/8/8/8/PPPPPPPP/RBQ1KRBN w AFaf - 0 1Expected behavior
https://github.com/lichess-bot-devs/lichess-bot/blob/master/lib/lichess_bot.py#L832-L835
This should also set the mode to
chess960=Trueif it's a"From Position"but with FRC castling rights. However, a quick test shows thatgame.initial_fenseems to have standard castling rights, so this might require some additional logic.Logs
Throws a uci move when handling the FRC castling:
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.