fix: reconcile worktree lifecycle transitions - #343
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 20 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: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe PR adds allowInactive dashboard model refresh handling for inactive sessions and refactors worktree create and graveyard mutations to use token-aware pending tracking with reconciliation. Tests and the completion tracker are updated, and one server error response changes from 500 to 422. ChangesDashboard refresh while inactive
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/multiplexer/worktrees.ts (1)
128-138: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winReuse the shared recoverability contract here
isRecoverableWorktreeRequestErrorfalls back tofalsefor opaque errors, unlikeisRecoverableTuiApiError, which falls back totrue. That sends unclassified create failures down the immediate error path instead of reconcile; reuse the shared helper or match its fallback.🤖 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 128 - 138, isRecoverableWorktreeRequestError currently diverges from the shared recoverability contract by returning false for opaque errors, which bypasses reconcile for unclassified failures; update it to reuse the same logic as isRecoverableTuiApiError or otherwise match its true-by-default fallback. Keep the existing recoverable/status/code checks in worktrees.ts, but ensure unknown errors are treated as recoverable so create failures follow the reconcile path consistently.
🤖 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/worktrees.test.ts`:
- Line 736: The `vi.waitFor` assertion in `worktrees.test.ts` is relying on the
default timeout, which is too tight for this pending-state transition and can
flake in CI. Update the `vi.waitFor` call in the worktree pending-state test to
pass an explicit longer timeout, matching the sibling test’s approach for
consistency and enough headroom. Use the existing `pending.state.get(...)`
assertion site to locate it.
---
Nitpick comments:
In `@src/multiplexer/worktrees.ts`:
- Around line 128-138: isRecoverableWorktreeRequestError currently diverges from
the shared recoverability contract by returning false for opaque errors, which
bypasses reconcile for unclassified failures; update it to reuse the same logic
as isRecoverableTuiApiError or otherwise match its true-by-default fallback.
Keep the existing recoverable/status/code checks in worktrees.ts, but ensure
unknown errors are treated as recoverable so create failures follow the
reconcile path consistently.
🪄 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: f222fa4c-93fe-4cf4-9a37-246ac0f7aaa9
📒 Files selected for processing (3)
docs/north-star-completion-tracker.mdsrc/multiplexer/worktrees.test.tssrc/multiplexer/worktrees.ts
|
@coderabbitai review |
|
Handled CodeRabbit summary recoverability finding in d290eff: worktree mutations now reuse isRecoverableTuiApiError for opaque/retryable failures while keeping explicit 501 create-unsupported responses terminal; synchronous worktree create domain failures now return 422 from the project service. |
✅ Action performedReview finished.
|
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/multiplexer/worktrees.test.ts`:
- Around line 1103-1146: The allowInactive check inside the mock for
refreshDashboardModelFromService is too brittle because a failed expectation can
be swallowed by the surrounding refresh error handling. Update the test to
capture the options passed into refreshDashboardModelFromService on each call
and assert after the async flow completes that at least one invocation included
allowInactive: true, so the failure surfaces as a real test assertion. Use the
existing symbols refreshDashboardModelFromService, beginWorktreeRemoval, and
attachPendingReapply to keep the assertion tied to the same scenario.
🪄 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: 3798d0d6-19a1-4af5-a8e3-16b261266572
📒 Files selected for processing (7)
src/metadata-server.tssrc/multiplexer/dashboard-api-client.test.tssrc/multiplexer/dashboard-api-client.tssrc/multiplexer/dashboard-model-service.test.tssrc/multiplexer/dashboard-model.tssrc/multiplexer/worktrees.test.tssrc/multiplexer/worktrees.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- src/multiplexer/worktrees.ts
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
Verification
Summary by CodeRabbit