fix(dev): honor OMB_PORT in the vite proxy, allow OMB_UI_PORT - #221
Conversation
The harness server reads `OMB_PORT || OGB_PORT || 8799` (server/index.ts:80), but the dev proxy only read the legacy `OGB_PORT`. Setting `OMB_PORT` — the documented name — moved the server without moving the proxy, so `pnpm dev` silently kept talking to 8799 and every /api call 404'd. This matters for running a second instance beside the first: `OMB_DATA_DIR` isolates the fleet and Electron already probes 8799/18799/28799 (electron/main.mjs:173), but the dev UI could not follow. The vite dev port was hardcoded too, so two `pnpm dev` processes collided on 5199. - proxy target now reads `OMB_PORT` first, keeping `OGB_PORT` as fallback - dev server port reads `OMB_UI_PORT`, defaulting to 5199 Both stay fully backward compatible: unset variables reproduce the previous behavior exactly. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan includes up to 3 reviews per rolling hour; 2 remain after this review. 📝 WalkthroughWalkthroughVite now reads ChangesVite port configuration
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to This change aligns the development proxy and UI port settings with the documented environment variables; no actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
The problem
The harness server reads
OMB_PORT || OGB_PORT || 8799(server/index.ts:80), but the dev proxy only read the legacyOGB_PORT(vite.config.ts:42).So setting
OMB_PORT— the documented, non-legacy name — moves the server but not the proxy.pnpm devsilently keeps talking to 8799 and every/apicall 404s, with nothing pointing at the cause.Why it matters
Running a second instance beside the first is already almost supported:
OMB_DATA_DIRisolates the fleet (server/config.ts:66)8799 / 18799 / 28799(electron/main.mjs:173)The dev UI was the one piece that couldn't follow. The vite dev port was hardcoded as well, so two
pnpm devprocesses collide on 5199.The change
OMB_PORTfirst, keepingOGB_PORTas fallbackOMB_UI_PORT, defaulting to 5199Two lines. Fully backward compatible — with both variables unset the behavior is byte-identical to before.
Verification
Two instances side by side:
Happy to drop the
OMB_UI_PORThalf if you'd rather keep the dev port fixed — the proxy fix is the part that's actually a bug.🤖 Generated with Claude Code
Summary by CodeRabbit
OMB_UI_PORT, with port 5199 used by default.