Distinguish between standard and chess960 From Position games#1147
Merged
AttackingOrDefending merged 2 commits intolichess-bot-devs:masterfrom Oct 15, 2025
Merged
Conversation
A "From Position" game can encode a chess960 position, which would allow chess960 challenges to bots that don't support them, leading to errors. This change checks the FEN string to see if it is a 960 game and declines the challenge if the bot does not play them.
AttackingOrDefending
approved these changes
Oct 14, 2025
Member
|
Is this ready to be merged, or do we wait for resolution to the weird castling fen described in the issue? |
Collaborator
Author
|
It's ready to merge. The varying FENs from lichess are handled by python-chess. I may write a bug report to lichess at some point in the future. There's nothing to do about it here and it doesn't cause problems. |
3d3b6c8
into
lichess-bot-devs:master
23 checks passed
r0950336
pushed a commit
to r0950336/lichess-bot
that referenced
this pull request
Dec 31, 2025
…s-bot-devs#1147) * Distinguish standard and 960 From Position games * Prevent chess960 challenges to unsupported bots A "From Position" game can encode a chess960 position, which would allow chess960 challenges to bots that don't support them, leading to errors. This change checks the FEN string to see if it is a 960 game and declines the challenge if the bot does not play them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of pull request:
Description:
There is no indication in the GameFullEvent whether a From Position game uses Chess960 rules or not. This change determines what kind of game is being played by seeing whether the
chess.Boardoptionchess960=Truechanges the state of the board. If it does, then the game is a 960 game.Related Issues:
Closes #1146
Checklist:
Screenshots/logs (if applicable):