fix(dev): make worktree startup resilient - #5026
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryIncremental review of commit Files Reviewed (4 files)
Previous Review Summary (commit 2041f75)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 2041f75)Status: 1 Issues Found | Recommendation: Address before merge Overview
The reserved-port skip logic and tmux stale-cwd wrapper are sound and well covered by regression tests; the only finding is a minor UX behavior change where the tmux dashboard window's interactive shell is hardcoded to Issue Details (click to expand)SUGGESTION
Files Reviewed (4 files)
Reviewed by kimi-k3 · Input: 60.3K · Output: 4.6K · Cached: 251.4K Review guidance: REVIEW.md from base branch |
Co-authored-by: kilo-code-bot[bot] <240665456+kilo-code-bot[bot]@users.noreply.github.com>
Summary
Make local development startup recover from stale shared tmux state and avoid an automatic port that Next.js rejects.
Why this change is needed
Worktree startup could stall while waiting for Stripe when a shared tmux server retained the working directory of a deleted sibling worktree. After recovering from that failure, automatic offset selection could assign port 6000 to Next.js, which Next.js rejects because it is in the X11 range.
These failures required developers to repair shared tmux state or manually choose another offset even though
dev:startis intended to isolate worktree sessions.How this is addressed
PWDorOLDPWDvalues.Human Verification
http://localhost:6100.uv_cwdorshell-initerrors.Reviewer Notes
Human Reviewer Flags
6000–6063) that Next.js rejects; explicit offsets remain authoritative.Code Reviewer Agent
Code Reviewer Notes
/bin/shto enter the worktree before starting the configured login shell, preventing shell initialization from resolving a deleted cwd.PWD; sessionOLDPWDis also reset.