[codex] Add opt-in dev port reclaim#5
Conversation
|
Warning Review limit reached
More reviews will be available in 39 minutes and 37 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. 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 (2)
📝 WalkthroughWalkthroughThis PR introduces an opt-in ChangesPort Reclaim Mechanism
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 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)
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. Comment |
There was a problem hiding this comment.
Pull request overview
Adds an opt-in mode to scripts/dev.sh to (safely) reclaim a worktree’s web port from stale same-worktree JS dev listeners, and documents the intended “print-only” port helper behavior and reclaim workflow.
Changes:
- Added
--reclaim-ports/--no-reclaim-ports(andDEVKIT_RECLAIM_PORTS=1) handling toscripts/dev.sh, with conservativelsof+ cwd/parent-chain + command signature checks before sendingSIGTERM. - Updated README and development docs to clarify
worktree-ports.sh envas print-only and to document safe port reclaim usage patterns.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| scripts/dev.sh | Adds opt-in port reclaim flow with process validation before terminating listeners. |
| README.md | Documents env as print-only and describes how to rerun dev with --reclaim-ports. |
| docs/development.md | Adds an “Optional Port Reclaim” section and references reclaim usage in the dev workflow docs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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 `@docs/development.md`:
- Around line 76-80: Replace the raw `docker compose up`/`down` guidance with
the repo wrapper script to keep worktree-safe behavior: update the text to
instruct using ./scripts/docker-compose.sh (and preserving use of
COMPOSE_PROJECT_NAME for stable project names) instead of raw `docker compose`,
and explicitly note that if an infrastructure port is already in use the wrapper
should report the owning process and ask the developer to stop it or change the
configured port.
🪄 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: c3959bd3-d41c-4444-8fce-aaa029ee9a99
📒 Files selected for processing (3)
README.mddocs/development.mdscripts/dev.sh
Summary
./scripts/dev.sh --reclaim-portsmode for stale same-worktree web dev listeners.lsof, cwd/path checks, parent-chain inspection, and service command matching before sendingSIGTERM.worktree-ports.sh envas the print-only URL/port mode and explain safe reclaim patterns for host-run app services versus Docker-owned infra.Validation
sh -n scripts/dev.sh./scripts/dev.sh --help./scripts/worktree-ports.sh envgit diff --check./scripts/check-all.shSummary by CodeRabbit
Release Notes
Documentation
New Features
--reclaim-portsflag to development script for resolving stale port conflicts from previous dev sessions, with built-in safety checks to verify process legitimacy.