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. |
|
Claude finished @ncnthien's task in 1m 24s —— View job Claude PR Review — feat: [ENG-2857] surface port-in-use error in brv webui (round 4)
SummaryOverall: 5 / 5 — Score holds from round 3. This synchronize event was triggered by the merge of Verification
Carry-over (already acknowledged, out of scope)
LGTM — still ready to ship. |
|
Claude finished @ncnthien's task in 56s —— View job Claude PR Review — feat: [ENG-2857] surface port-in-use error in brv webui (round 5)
SummaryOverall: 5 / 5 — Score holds from rounds 3 and 4. This synchronize event was triggered by another merge of Verification
Carried-over (still acknowledged, out of scope)
LGTM — still ready to ship. |
|
Claude finished @ncnthien's task in 3m 51s —— View job Claude PR Review — feat: [ENG-2857] surface port-in-use error in brv webui (round 6)
SummaryOverall: 4 / 5 — Score drops one notch from round 5's 5/5. The new commit What this commit adds
Findings (see inline)
Carried-over (still acknowledged, out of scope here)
Verification
|
|
Hey @ncnthien , please have a look on port issue that current uses as IPv6 instead of IPv4, that doesn't cover in current code
brv's webui binds IPv4-only because server/constants.ts:43 sets TRANSPORT_HOST = '127.0.0.1'. Docker holds the IPv6 wildcard [::]:7700. Those two coexist at the OS level — there is no EADDRINUSE — so:
Proof from your machine: curl -4 localhost:7700/api/ui/config → HTTP 200 (brv, works) curl -6 localhost:7700/api/ui/config → HTTP 000 (Docker, broken) curl localhost:7700 (browser path)→ ::1, HTTP 000 Why the ENG-2697 fix doesn't catch it The conflict detection on this branch keys entirely off EADDRINUSE → WebUiPortInUseError → port_in_use (brv-server.ts:236-238, webui-server.ts:42). Because brv binds IPv4-specific and the other app holds the IPv6 wildcard, the OS never raises that error. The fix literally cannot see this collision, so it keeps reporting 7700 as ok. Fix it now (pick one)
The real code fix Two complementary options, and the first is small + directly in the spirit of this branch ("use printed webui URL in skill guidance"):
Want me to implement #1 (the minimal, TDD'd fix), #2, or both? Root cause: an IPv4 / IPv6 split on 7700 Port 7700 is not free, but brv can't tell. Two things are bound to it right now: Listener Bind address Stack Docker container 11111 (host 7700 → Redis 6379) 0.0.0.0:7700 + [::]:7700 IPv6 wildcard brv daemon (PID 80926) 127.0.0.1:7700 IPv4 only brv's webui binds IPv4-only because [server/constants.ts:43](vscode-webview://0j4knuqbc4fituqn7gq00jlrmhcvrt9a21vage3f3gh0dkoi8vhv/src/server/constants.ts#L43) sets TRANSPORT_HOST = '127.0.0.1'. Docker holds the IPv6 wildcard [::]:7700. Those two coexist at the OS level — there is no EADDRINUSE — so: 1. webuiServer.start(7700) succeeds → GET_PORT returns {port: 7700, status: 'ok'} → CLI prints http://localhost:7700. 2. But when your browser opens http://localhost:7700, macOS resolves localhost to both 127.0.0.1 and ::1, and browsers/curl prefer IPv6 ::1 first → they connect to Docker's Redis, not brv → blank/broken page. Proof from your machine:curl -4 localhost:7700/api/ui/config → HTTP 200 (brv, works)
|
|
Claude finished @ncnthien's task in 3m 38s —— View job Claude PR Review — feat: [ENG-2857] surface port-in-use error in brv webui (round 7)
SummaryOverall: 5 / 5 — Round-6 blocking finding (no tests for the new auto-fallback critical path) and design nit ( What was addressed (round 6)
Findings this round (see inline)
Carry-over (still acknowledged, out of scope)
Verification
LGTM — ready to ship. The IPv4/IPv6 observation is worth a brief judgment call before merging (one-line URL change or defer to a follow-up). — Branch: feat/ENG-2857 · |
|
Claude finished @ncnthien's task in 3m 2s —— View job Claude PR Review — feat: [ENG-2857] surface port-in-use error in brv webui (round 8)
SummaryOverall: 5 / 5 — All five round-7 findings are cleanly resolved with no regressions. The new commit ( What was addressed (round 7)
Findings this roundNone blocking. Posted four praise-only inline comments on the round-7 resolutions. Carried-over (already acknowledged, out of scope)
Verification
LGTM — ready to ship. — Branch: feat/ENG-2857 · |
|
Claude finished @ncnthien's task in 2m 16s —— View job Claude PR Review — feat: [ENG-2857] surface port-in-use error in brv webui (round 9)
SummaryOverall: 4 / 5 — Drops one notch from round 8's 5/5. Round 8 had a tidy IPv4 URL fix that closed @DatPham-6996's reported bug; this round reverts it back to What changed in round 9Single feature commit:
No test changes, no source-of-truth code logic changed. Findings this round (see inline)
Carried-over (still acknowledged, out of scope)
Verification
— Branch: feat/ENG-2857 |
|
Claude finished @ncnthien's task in 1m 19s —— View job Claude PR Review — feat: [ENG-2857] surface port-in-use error in brv webui (round 10)
SummaryOverall: 5 / 5 — Climbs back from round 9's 4/5. The single new commit ( What changed in round 10
Findings this roundNone. Carry-over (still acknowledged, out of scope)
Repo-hygiene note (non-blocking)
Verification
LGTM — ready to ship. — · Branch: feat/ENG-2857 |
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)