feat: [ENG-2857] surface port-in-use error in brv webui#704
Conversation
|
Claude finished @ncnthien's task in 5m 18s —— View job Claude PR Review — feat: [ENG-2857] surface port-in-use error in brv webui
SummaryOverall: 4 / 5 — Solid, well-scoped UX improvement with proper typed errors and a clean discriminated-union transport contract. One real bug in the Highlights (what's good)
Findings (see inline comments)
Other notes (no inline)
Verification
|
… typed already-running error, stale-state fix
|
Claude finished @ncnthien's task in 4m 25s —— View job Claude PR Review — feat: [ENG-2857] surface port-in-use error in brv webui (round 2)
SummaryOverall: 4 / 5 — Round 1 feedback is almost fully addressed: explicit What was addressed (prior round)
Findings this round (see inline comments)
Other notes (no inline, pre-existing)
Verification
|
|
Claude finished @ncnthien's task in 1m 57s —— View job Claude PR Review — feat: [ENG-2857] surface port-in-use error in brv webui (round 3)
SummaryOverall: 5 / 5 — Round-2 blocking issue is cleanly resolved. Score bumps from 4 → 5 because all blockers are now addressed and only the explicitly-deferred UX item remains (probe-then-stop in What was addressed (round 2)
Findings this roundNone blocking. One small observation, no inline:
Carried-over (acknowledged out of scope, no action needed)
Verification
LGTM — ready to ship. |
Summary
Failed to get web UI port. Use \brv restart`...with a specific message that points the user atbrv webui --portwhen the Web UI port (default 7700) is held by another process. Same guidance applies whether the conflict shows up at daemon boot (webui:getPort) or mid-run via--port(webui:setPort`).WebUiPortInUseErrorthrown byWebUiServeronEADDRINUSE. Daemon catches it, tracks the failure, and propagates a typedreasonover the transport instead of swallowing or throwing a plainError.src/shared/transport/events/webui-events.tswithWebuiEventsconstant and discriminated-union response types replacing the inline{port?: number}shapes — TypeScript now narrows the CLI branches automatically.--port,BRV_WEBUI_PORT) lives only in the CLI message — single source of truth.Test plan
npm run typecheck— passesnpx eslint src/— 0 errors on touched filesnpx mocha "test/unit/core/domain/errors/webui-error.test.ts" "test/unit/infra/webui/**/*.test.ts"— 21 passing127.0.0.1:7700, run./bin/run.js webui→ boot-conflict message fires127.0.0.1:9090, run./bin/run.js webui -p 9090→ setPort-conflict message firesbrv webui --port <free>clears the failure stateformatConnectionError(verified withBRV_IAM_BASE_URL='' ./bin/run.js webui)