Skip to content

Remove active games when challenge canceled#1167

Merged
AttackingOrDefending merged 1 commit into
lichess-bot-devs:masterfrom
MarkZH:MarkZH/issue1166
Dec 23, 2025
Merged

Remove active games when challenge canceled#1167
AttackingOrDefending merged 1 commit into
lichess-bot-devs:masterfrom
MarkZH:MarkZH/issue1166

Conversation

@MarkZH
Copy link
Copy Markdown
Collaborator

@MarkZH MarkZH commented Dec 23, 2025

Fixes #1166

Type of pull request:

  • Bug fix
  • Feature
  • Other

Description:

If a challenge is accepted by a bot, but the challenge is canceled before the game starts, then the game ID remains in the active_games set and will never be removed. This effectively reduces the number of simultaneous games a bot can play by one each time it happens. This change removes the game ID from active_games when a challenge is canceled.

Related Issues:

Fixes #1166

Checklist:

  • I have read and followed the contribution guidelines.
  • I have added necessary documentation (if applicable).
  • The changes pass all existing tests.

Screenshots/logs (if applicable):

@AttackingOrDefending
Copy link
Copy Markdown
Member

If we get more bugs with active_games it might be worth periodically overwriting active games with the games we get from li.get_ongoing_games() just like we do at startup as a fail-safe.

@AttackingOrDefending AttackingOrDefending merged commit 54e3778 into lichess-bot-devs:master Dec 23, 2025
23 checks passed
@MarkZH MarkZH deleted the MarkZH/issue1166 branch December 23, 2025 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LeelaPieceOdds leaks game ids into active_game set when server changes a game id

2 participants