feat: support configuring seek time control via env var#33
Conversation
Configure standing seeks with a time control using the BOT_SEEK_TIME_CONTROL env var. Closes #32
|
Warning Review limit reached
Next review available in: 47 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
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. Comment |
There was a problem hiding this comment.
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.
| case Array(initialMin, incSec) => | ||
| for | ||
| initSec <- initialMin.toIntOption.map(_ * 60) | ||
| inc <- incSec.toIntOption | ||
| yield TimeControl.Fischer(initSec, inc) |
There was a problem hiding this comment.
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)| 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) | ||
| ) |
There was a problem hiding this comment.
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)
)
|



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