Note
Reviews paused
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.
- Last reviewed commit: 46796c3dd465cd2ba181747a6fdaa8848df6f01b
Use the following commands to manage reviews:
@coderabbitai resumeto resume automatic reviews.@coderabbitai reviewto trigger a single review.
Use the checkboxes below for quick actions:
- Resume reviews
- Trigger review
Walkthrough
-
Automatic environment balancing now applies to eligible scratch drafts. ChatView evaluates draft state, attachments, and file references. Manual and automatic moves share a flow that checks whether requests remain current and opens a scratch project when needed.
Changes: Scratch draft routing
Layer / File(s) Summary Automatic balancing eligibility
apps/web/src/components/ChatView.logic.ts,apps/web/src/components/ChatView.logic.test.ts,apps/web/src/components/ChatView.tsxresolveAutomaticEnvironmentuses readiness, environment availability, load-balancing state, attachments, file references, and branch or worktree state. ChatView uses this resolver and enables auto-environment controls when multiple environments are available. Tests cover file-link and web-link cases.Shared draft-move flow
apps/web/src/components/chat/useDraftEnvironmentRouting.ts,apps/web/src/components/chat/useDraftEnvironmentRouting.browser.test.tsxManual and automatic moves share checks for scope, send state, draft identity and promotion, and automatic candidate membership. A current automatic move that cannot open a scratch project records the draft’s current environment. Browser tests cover successful and unsuccessful opens, lost eligibility, and competing moves. Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Bug fix · Severity of issue fixed: Low
Sequence Diagram(s)
mermaid1 sequenceDiagram 2 participant BalancingCandidates 3 participant useDraftEnvironmentRouting 4 participant ScratchProjectOpening 5 participant DraftStore 6 BalancingCandidates->>useDraftEnvironmentRouting: Provide settled candidate 7 useDraftEnvironmentRouting->>ScratchProjectOpening: Open folder for selected environment 8 ScratchProjectOpening->>useDraftEnvironmentRouting: Return project or no project 9 useDraftEnvironmentRouting->>DraftStore: Apply move if request remains current Possibly related issues
Suggested reviewers:
juliusmarminge,t3dotgg
Merge Risk: External image Low · up to 46796
-
Scratch drafts that contain typed @ file mentions can still be moved to another machine where the file does not exist. The scope is narrow and the manual switch already behaves this way. Detect these mentions before merging or accept the gap explicitly.
Pre-merge checks: Passed 4
-
Check name Status Explanation Title check Passed The title clearly and concisely describes the main change: enabling load balancing for drafts without a project. Description check Passed The description includes complete Problem, Change, Scope and approval, and Verification sections. It explains the behavior change, implementation, linked issue, tests, observed results, limitations, a… Linked Issues check Passed [ #31048]ChatViewno longer excludes scratch drafts from automatic balancing. It exposes Auto balance when multiple environments and load balancing are available.useDraftEnvironmentRoutingsends …Out of Scope Changes check Passed The changes stay within the linked web behavior. ChatView.logicpreserves automatic-routing restrictions for attachments and scratch file references. The routing refactor shares the existing manual …Full details: Description check
-
Explanation
The description includes complete Problem, Change, Scope and approval, and Verification sections. It explains the behavior change, implementation, linked issue, tests, observed results, limitations, and visual evidence.
Full details: Linked Issues check
-
Explanation
[
#31048]ChatViewno longer excludes scratch drafts from automatic balancing. It exposes Auto balance when multiple environments and load balancing are available.useDraftEnvironmentRoutingsends the selected environment throughmoveDraft, opens the scratch project when needed, and retargets the draft withenvironmentSelection: "auto". The added browser tests cover successful routing, scratch-project open failure, stale candidate changes, and Auto balance superseding a manual switch. The implementation meets the linked issue's web coding requirements.
Full details: Out of Scope Changes check
-
Explanation
The changes stay within the linked web behavior.
ChatView.logicpreserves automatic-routing restrictions for attachments and scratch file references. The routing refactor shares the existing manual move path and adds guards for asynchronous balancing. The related unit and browser tests verify these rules. No unrelated product area or excluded file change is identified.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts