Skip to content

Conversation

@noamloewenstern
Copy link

@noamloewenstern noamloewenstern commented Jan 30, 2026

Summary

Fixes max concurrency setting not being saved when no worktree is selected (main/primary worktree).

The bug was in the onConcurrencyChange handler in board-view.tsx which required both currentProject AND selectedWorktree to be truthy. However, selectedWorktree can be null/undefined when viewing the main worktree, preventing the setting from being saved.

Related Issue

Closes #719

Changes

  • Changed condition from if (currentProject && selectedWorktree) to if (currentProject)
  • Added explicit null fallback handling for selectedWorktree
  • Added clarifying comments about the null behavior

Testing

  • Verified max concurrency can be saved when no worktree selected
  • Verified max concurrency can still be saved for feature branch worktrees
  • Verified auto mode respects the saved setting

Summary by CodeRabbit

  • Bug Fixes

    • Concurrency settings now apply when a project is open even if no specific worktree is selected.
    • Branch detection improved to treat the main/default worktree distinctly, avoiding incorrect branch assignments.
  • Chores

    • No public API or exported signatures were changed.

✏️ Tip: You can customize this high-level summary in your review settings.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @noamloewenstern, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a bug preventing the maximum concurrency setting from being saved when the user is viewing the main or primary worktree. The issue stemmed from an overly strict conditional check that expected a "selectedWorktree" to always be present. By refining this condition and explicitly handling the "null" state for the main worktree, the change ensures that concurrency settings can now be persistently applied across all worktree contexts, improving the reliability of user configurations.

Highlights

  • Conditional Logic Update: The condition for saving the maximum concurrency setting was relaxed from requiring both "currentProject" and "selectedWorktree" to only requiring "currentProject".
  • Null Worktree Handling: The logic for determining the "branchName" now explicitly handles "selectedWorktree" being "null" or "undefined", correctly mapping it to the main/primary worktree.
  • Code Clarity: Added clarifying comments to the "onConcurrencyChange" handler to explain the new null fallback behavior for "selectedWorktree".

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link

coderabbitai bot commented Jan 30, 2026

📝 Walkthrough

Walkthrough

BoardView's concurrency handler no longer requires a selected worktree; it proceeds when currentProject is defined and computes branchName as null for main/no-worktree or selectedWorktree.branch for non-main worktrees.

Changes

Cohort / File(s) Summary
Max Concurrency Handler
apps/ui/src/components/views/board-view.tsx
Removed selectedWorktree requirement from the concurrency update guard. Now uses currentProject only and derives branchName as selectedWorktree?.isMain === false ? selectedWorktree.branch : null, preserving downstream concurrency update and auto-mode restart logic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped to the board, with settings in view,
I nudged max concurrency — and saved it too.
No branch selected, yet nothing was lost,
Main branch kept safe, no accidental cost.
A cheerful fix — now the sliders are true.

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main change: fixing the null selectedWorktree handling in the max concurrency handler.
Linked Issues check ✅ Passed The code changes directly address issue #719 by removing the selectedWorktree requirement and adding explicit null fallback handling as specified.
Out of Scope Changes check ✅ Passed All changes in board-view.tsx are directly related to fixing the max concurrency handler behavior as defined in issue #719; no out-of-scope modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

Copy link
Contributor

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

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 correctly addresses a bug where the max concurrency setting was not being saved for the main worktree. The fix is sound, removing the incorrect check for selectedWorktree. I've added one minor suggestion to simplify the logic for determining the branch name, which could improve readability and maintainability. Otherwise, the changes look good.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
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.

[Bug]: Max concurrency agents setting not saved when no worktree selected

2 participants