Route TUI actions through project service - #202
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
More reviews will be available in 29 minutes and 49 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?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 credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. 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, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughTask assignment API contracts are extended with optional ChangesDashboard-mode enforcement and review task metadata
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/multiplexer/worktrees.ts (1)
389-397:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winKeep focus on the remaining worktree after removing the last item.
When the removed worktree was the last of two,
oldIdxis now outside the new one-item nav order, and thelength > 1branch setsfocusedWorktreePathtoundefinedeven though one worktree remains.Proposed fix
- } else if (host.dashboardState.worktreeNavOrder.length > 1) { + } else if (host.dashboardState.worktreeNavOrder.length > 0) { host.dashboardState.focusedWorktreePath = host.dashboardState.worktreeNavOrder[host.dashboardState.worktreeNavOrder.length - 1];🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/multiplexer/worktrees.ts` around lines 389 - 397, The logic for determining the focused worktree after removal has a boundary condition error. When a worktree is removed and oldIdx becomes out of bounds, the second condition checks if worktreeNavOrder.length > 1 before focusing on the remaining worktree. However, when exactly one worktree remains (length == 1), this condition fails and focusedWorktreePath is set to undefined instead of focusing on the last remaining worktree. Change the condition from length > 1 to length > 0 in the else-if statement to ensure that whenever at least one worktree remains in the worktreeNavOrder array, the focus is set to the last worktree in that array rather than being undefined.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/multiplexer/dashboard-control.ts`:
- Around line 571-574: In the function showOrchestrationRoutePicker, the guard
condition checking host.mode and host.getFromProjectService is currently placed
after calls to getSelectedDashboardSessionForActions and access to
host.dashboardState.focusedWorktreePath. Move the entire if statement guard to
the beginning of the function, before any operations that depend on dashboard
state being initialized, so that the validation happens first and prevents
accessing uninitialized state when the guard conditions fail.
In `@src/multiplexer/dashboard-interaction.test.ts`:
- Around line 7-30: The test "requests reviews through the project service"
assumes a default coder to reviewer role mapping, but the handleReviewRequest
method calls loadTeamConfig() which reads from actual project or global
configuration files and can change the assignee. Mock the loadTeamConfig
function or team config dependency in the test setup to ensure the role mapping
is controlled and deterministic, so the test always uses the expected "coder →
reviewer" mapping regardless of what configuration files exist on the system.
In `@src/multiplexer/dashboard-interaction.ts`:
- Around line 907-920: The git diff command in the try block is executing in the
multiplexer process's working directory instead of the session's worktree
directory, which can attach the wrong diff to the review request. Modify the
execSync call to use the cwd option and pass the worktreePath obtained from
this.sessionWorktreePaths?.get?.(session.id) to ensure the git diff HEAD command
runs in the correct session worktree directory. Only execute the command if the
worktreePath is available.
- Around line 885-899: The code does not validate the loaded team configuration
before accessing its properties, which can cause runtime errors if the config is
malformed and lacks the required `roles` property or if role configs are missing
expected properties like `description` or `canEdit`. Add validation after the
loadTeamConfig call to ensure the returned team object has a valid roles
property and that each role config has the necessary properties (description,
canEdit, reviewedBy) before attempting to dereference them in the roleConfig
assignment and the filter and find operations. If validation fails, return the
default team config as a fallback to prevent dereferencing undefined properties.
In `@src/multiplexer/inbox-cleanup-runtime.test.ts`:
- Around line 52-53: The test only waits for the refreshCoordinationFromService
call to complete, but renderCurrentDashboardView is invoked asynchronously in a
.then() continuation after that promise resolves, creating a race condition.
Wrap the expectation for host.renderCurrentDashboardView.toHaveBeenCalledOnce()
in a vi.waitFor() call to ensure the test waits for the render side effect to
actually execute before asserting on it, similar to how the
refreshCoordinationFromService expectation is already wrapped.
In `@src/multiplexer/worktrees.ts`:
- Around line 345-348: The finishWorktreeRemoval function call in the host.mode
!== "dashboard" condition block is emitting a generic error message that
overwrites the specific "Worktree graveyard requires the project service." error
shown via showDashboardError. To fix this, pass the specific error message as
stderr or error details to the finishWorktreeRemoval(host, 1) call so that the
meaningful error message is preserved instead of being replaced by the generic
"worktree graveyard failed with code 1" message.
---
Outside diff comments:
In `@src/multiplexer/worktrees.ts`:
- Around line 389-397: The logic for determining the focused worktree after
removal has a boundary condition error. When a worktree is removed and oldIdx
becomes out of bounds, the second condition checks if worktreeNavOrder.length >
1 before focusing on the remaining worktree. However, when exactly one worktree
remains (length == 1), this condition fails and focusedWorktreePath is set to
undefined instead of focusing on the last remaining worktree. Change the
condition from length > 1 to length > 0 in the else-if statement to ensure that
whenever at least one worktree remains in the worktreeNavOrder array, the focus
is set to the last worktree in that array rather than being undefined.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 5b3e933f-cd07-4cc7-8e6b-a113b45051a3
📒 Files selected for processing (6)
src/multiplexer/dashboard-control.tssrc/multiplexer/dashboard-interaction.test.tssrc/multiplexer/dashboard-interaction.tssrc/multiplexer/inbox-cleanup-runtime.test.tssrc/multiplexer/persistence-methods.tssrc/multiplexer/worktrees.ts
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/orchestration-actions.ts`:
- Around line 70-75: The assignment of task.iteration in the review task type
block directly uses input.iteration without validation, allowing invalid values
like zero, negative numbers, or non-integers to be persisted. Add validation
logic before the assignment to ensure input.iteration is a positive integer, and
if invalid or missing, default to 1 instead. This validation should occur within
the if (task.type === "review") block before assigning to task.iteration to
prevent downstream issues with the iteration > 5 safety cutoff check.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 733d0f8e-b32a-450d-a12c-036dfc8758dc
📒 Files selected for processing (9)
src/metadata-server.test.tssrc/metadata-server.tssrc/multiplexer/dashboard-control.tssrc/multiplexer/dashboard-interaction.test.tssrc/multiplexer/dashboard-interaction.tssrc/multiplexer/inbox-cleanup-runtime.test.tssrc/multiplexer/worktrees.tssrc/orchestration-actions.tssrc/project-api-contract.ts
✅ Files skipped from review due to trivial changes (1)
- src/project-api-contract.ts
🚧 Files skipped from review as they are similar to previous changes (4)
- src/multiplexer/inbox-cleanup-runtime.test.ts
- src/multiplexer/dashboard-interaction.test.ts
- src/multiplexer/worktrees.ts
- src/multiplexer/dashboard-control.ts
Summary
Verification
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Changes