[codex] Use Conductor port range for worktree defaults#294
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThis PR integrates Conductor-aware port management across the dev environment: ChangesConductor Port Scheme and Workspace Management
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
This PR updates the worktree environment port-defaulting logic to honor Conductor’s CONDUCTOR_PORT-assigned 10-port workspace range when available, keeping existing explicit override precedence and adding a hard failure for browser-unsafe Conductor-derived HTTP defaults.
Changes:
- Add
CONDUCTOR_PORT-based default port mapping (+0..+6) inworktree_env_loadand fail loudly on browser-unsafe Conductor defaults. - Update unit tests to cover Conductor default mapping, override precedence, range validation, and unsafe-port rejection.
- Document the Conductor port mapping and updated default rules in
README.mdandENVIRONMENT.md.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
scripts/worktree-env.sh |
Introduces Conductor-aware default port computation and stricter handling for browser-unsafe Conductor-derived defaults. |
tests/unit/test_worktree_env.py |
Adds test coverage for Conductor port-range defaults, override behavior, and failure modes. |
README.md |
Documents Conductor port mapping and updates default-port descriptions for impacted variables. |
ENVIRONMENT.md |
Mirrors README’s Conductor mapping/docs for environment variable defaults. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 50b5e46b31
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0979efc1ec
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 20e98caf37
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
CONDUCTOR_PORTas the base for unset worktree port defaults inside Conductor workspaces.+0, Postgres+1, Compose web+2, MinIO API+3, MinIO console+4, host-run web/API+5, and bot health+6.scripts/archive-workspace.shwith--dry-runsupport to stop workspace-scoped host dev processes and run./scripts/docker-compose.sh down --remove-orphans../scripts/dev.sh weband./scripts/dev.sh discord-botto reclaim occupied dev ports from same-service processes in the same Conductor repo workspace group before startup.Why
Conductor assigns each workspace a narrow 10-port range via
CONDUCTOR_PORT. The previous worktree defaults spread service ports across broad deterministic ranges, which made Conductor port allocation less useful and increased the chance of workspace port mismatch.Archived or stale workspaces can also leave host-run dev processes behind. The archive helper scopes cleanup to this workspace by command path, cwd, descendant process tree, or this workspace's assigned Conductor listener ports. The dev run path now also handles the common startup failure where a stale same-service listener from a sibling
508-workflowsConductor workspace still owns the desired port.Validation
/bin/sh -n scripts/worktree-env.sh scripts/dev.sh scripts/docker-compose.sh/bin/bash -n scripts/archive-workspace.sh./scripts/archive-workspace.sh --helpCONDUCTOR_PORT=45000 ./scripts/archive-workspace.sh --dry-run --skip-dockerCONDUCTOR_PORT=45000 ./scripts/archive-workspace.sh --dry-runuv run pytest tests/unit/test_worktree_env.pyuv run pytest tests/unit/test_dev_mux.py tests/unit/test_worktree_env.pyuv run ruff check scripts/dev_mux.py tests/unit/test_dev_mux.pyuv run mypy scripts/dev_mux.py tests/unit/test_dev_mux.pyCONDUCTOR_PORT=45000 ./scripts/dev.sh portsCONDUCTOR_PORT=45000 ./scripts/docker-compose.sh print-portspython3 scripts/dev_mux.py --ensure-port weband--ensure-port discord-botwith resolved dev envSummary by CodeRabbit
Release Notes
New Features
Documentation