Skip to content

feat: support configuring seek time control via env var#33

Merged
rabestro merged 5 commits into
mainfrom
feat/32-time-control-for-seeks
Jul 9, 2026
Merged

feat: support configuring seek time control via env var#33
rabestro merged 5 commits into
mainfrom
feat/32-time-control-for-seeks

Conversation

@rabestro

@rabestro rabestro commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Configure standing seeks with a time control using the BOT_SEEK_TIME_CONTROL env var. Closes #32

Configure standing seeks with a time control using the BOT_SEEK_TIME_CONTROL env var.
Closes #32
@rabestro rabestro added enhancement New feature or request engine Integration with the Dice Chess engine labels Jul 9, 2026
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@rabestro, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 47 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 38f4c1c0-f7c5-4329-b54a-d981d8e14396

📥 Commits

Reviewing files that changed from the base of the PR and between 0456504 and a81ea7f.

📒 Files selected for processing (6)
  • README.md
  • build.sbt
  • docker-compose.yaml
  • src/main/scala/dicechess/refbot/Config.scala
  • src/main/scala/dicechess/refbot/ReferenceBot.scala
  • src/test/scala/dicechess/refbot/ConfigSuite.scala

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the testing Adding or enhancing automated tests label Jul 9, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for a new configuration variable, BOT_SEEK_TIME_CONTROL, allowing the bot to create standing seeks with specific time controls (either Fischer or Sudden Death). It also refactors the configuration loading to be map-based for easier testing and adds a suite of unit tests. The review feedback suggests improving the robustness of the time control parser by trimming whitespace around the + delimiter to prevent parsing failures on inputs like "10 + 10", and adding corresponding test cases for these edge cases and invalid formats.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +39 to +43
case Array(initialMin, incSec) =>
for
initSec <- initialMin.toIntOption.map(_ * 60)
inc <- incSec.toIntOption
yield TimeControl.Fischer(initSec, inc)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

If the environment variable contains spaces around the + sign (e.g., "10 + 10"), the split parts will contain leading/trailing spaces (e.g., "10 " and " 10"). Since String.toIntOption does not ignore surrounding whitespace, parsing will fail and return None. Trimming each part before parsing resolves this issue.

        case Array(initialMin, incSec) =>
          for
            initSec <- initialMin.trim.toIntOption.map(_ * 60)
            inc     <- incSec.trim.toIntOption
          yield TimeControl.Fischer(initSec, inc)

Comment on lines +8 to +15
val cases = List(
("10+10", Some(TimeControl.Fischer(600, 10))),
("5+3", Some(TimeControl.Fischer(300, 3))),
("10", Some(TimeControl.SuddenDeath(600))),
("5", Some(TimeControl.SuddenDeath(300))),
("", None),
(" ", None)
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Add test cases to verify that spaces around the + sign (e.g., "10 + 10") and invalid formats are handled correctly.

    val cases = List(
      ("10+10", Some(TimeControl.Fischer(600, 10))),
      ("10 + 10", Some(TimeControl.Fischer(600, 10))),
      ("5+3", Some(TimeControl.Fischer(300, 3))),
      ("10", Some(TimeControl.SuddenDeath(600))),
      ("5", Some(TimeControl.SuddenDeath(300))),
      ("", None),
      ("   ", None),
      ("invalid", None),
      ("10+invalid", None)
    )

@rabestro rabestro self-assigned this Jul 9, 2026
@github-actions github-actions Bot added ci-cd Continuous integration pipelines and deployment setups infrastructure Docker and deployment configurations labels Jul 9, 2026
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jul 9, 2026
@sonarqubecloud

sonarqubecloud Bot commented Jul 9, 2026

Copy link
Copy Markdown

@rabestro rabestro merged commit 398b420 into main Jul 9, 2026
6 checks passed
@rabestro rabestro deleted the feat/32-time-control-for-seeks branch July 9, 2026 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-cd Continuous integration pipelines and deployment setups documentation Improvements or additions to documentation engine Integration with the Dice Chess engine enhancement New feature or request infrastructure Docker and deployment configurations testing Adding or enhancing automated tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support time control for automated lobby seeks

1 participant