Skip to content

fix(dev): honor OMB_PORT in the vite proxy, allow OMB_UI_PORT - #221

Merged
milind-soni merged 1 commit into
milind-soni:mainfrom
jpun:fix-dev-port-env
Aug 18, 2026
Merged

milind-soni merged 1 commit into
milind-soni:mainfrom
jpun:fix-dev-port-env

Conversation

@jpun

@jpun jpun commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

The problem

The harness server reads OMB_PORT || OGB_PORT || 8799 (server/index.ts:80), but the dev proxy only read the legacy OGB_PORT (vite.config.ts:42).

So setting OMB_PORT — the documented, non-legacy name — moves the server but not the proxy. pnpm dev silently keeps talking to 8799 and every /api call 404s, with nothing pointing at the cause.

Why it matters

Running a second instance beside the first is already almost supported:

The dev UI was the one piece that couldn't follow. The vite dev port was hardcoded as well, so two pnpm dev processes collide on 5199.

The change

  • proxy target reads OMB_PORT first, keeping OGB_PORT as fallback
  • dev server port reads OMB_UI_PORT, defaulting to 5199

Two lines. Fully backward compatible — with both variables unset the behavior is byte-identical to before.

Verification

pnpm typecheck   # passes
npx oxlint vite.config.ts   # clean

Two instances side by side:

# instance A — unchanged defaults
pnpm dev:server && pnpm dev

# instance B
OMB_DATA_DIR="$HOME/.openmausbot-dev" OMB_PORT=18799 pnpm dev:server
OMB_PORT=18799 OMB_UI_PORT=15199 pnpm dev

Happy to drop the OMB_UI_PORT half 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

  • Configuration
    • The development server port can now be customized through OMB_UI_PORT, with port 5199 used by default.
    • API proxy routing now supports configurable backend ports, with fallback options for improved setup flexibility.

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>
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2435130d-9a5c-40e4-96c5-1b879e7e45e6

📥 Commits

Reviewing files that changed from the base of the PR and between 0024d14 and b8d9a83.

📒 Files selected for processing (1)
  • vite.config.ts

Included review availability: Your plan includes up to 3 reviews per rolling hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

Vite now reads OMB_UI_PORT for the development server and uses OMB_PORT, OGB_PORT, or 8799 for the /api proxy target.

Changes

Vite port configuration

Layer / File(s) Summary
Environment-based port selection
vite.config.ts
The development server reads OMB_UI_PORT with a 5199 fallback. The /api proxy target prioritizes OMB_PORT, then OGB_PORT, and finally 8799.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to b8d9a

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: milind-soni, mnthr7

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the proxy port fix and configurable Vite UI port.
Description check ✅ Passed The description explains the problem, changes, rationale, verification, and compatibility impact, but omits the template checklist.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@milind-soni
milind-soni merged commit e7d71f4 into milind-soni:main Aug 18, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants