#18549: Fix: align DEFAULT_BROWSER_CONTROL_PORT with base+2 derivation logic …
stale
size: XS
Cluster:
Chrome Extension Enhancements
Fix: align DEFAULT_BROWSER_CONTROL_PORT with base+2 derivation logic
## Summary
- **Problem:** `DEFAULT_BROWSER_CONTROL_PORT` was hardcoded to `18791` (offset of 1), but the `deriveDefaultBrowserControlPort` function calculates it using an offset of `2`.
- **Why it matters:** This inconsistency causes port mismatch errors when the browser service attempts to bind to the wrong port.
- **What changed:** Updated `DEFAULT_BROWSER_CONTROL_PORT` in `src/config/port-defaults.ts` from `18791` to `18792`.
- **What did NOT change:** No logic changes were made; only the default constant was aligned to match the existing logic.
## Change Type
- [x] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Docs
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
this PR attempts to fix port alignment but introduces a mathematical error that will break existing functionality.
**Issues found:**
- `DEFAULT_BROWSER_CONTROL_PORT` changed from `18791` to `18792`, but the correct value is `18791` (gateway `18789` + offset `2`)
- this change breaks the test at `src/browser/config.test.ts:8` which expects `18791`
- contradicts documentation stating "default: `18791`, which is gateway + 2"
- disrupts the port allocation scheme where browser control uses `18791` and the relay uses the next port (`18792`)
**Root cause:**
the PR description claims the old value `18791` was "offset of 1" but this is incorrect - `18791 = 18789 + 2`, which correctly matches the offset of 2 used in `deriveDefaultBrowserControlPort`.
<h3>Confidence Score: 0/5</h3>
- This PR contains a critical mathematical error that will break functionality
- Score of 0 because the change is mathematically incorrect (18789 + 2 = 18791, not 18792), will break existing tests, contradicts documentation, and disrupts the established port allocation scheme
- src/config/port-defaults.ts requires correction - the value must be reverted to 18791
<sub>Last reviewed commit: 715fc1d</sub>
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#8745: fix(gateway): respect gateway.port config and --port CLI flag
by revenuestack · 2026-02-04
77.4%
#22252: fix(chrome-extension): connection validation and clarify relay port...
by krizpoon · 2026-02-20
71.7%
#7852: fix(gateway): use port from Host header for canvasHostUrl (reverse ...
by tonimelisma · 2026-02-03
71.6%
#17645: fix: browser control service actually start HTTP server in Docker
by MisterGuy420 · 2026-02-16
71.1%
#9020: fix(browser): skip port ownership and WS reachability checks for re...
by yepack · 2026-02-04
70.4%
#15595: fix(browser): avoid local port conflicts for remote cdp
by TsekaLuk · 2026-02-13
69.7%
#21000: fix: resolve option collision between browser and cookies set commands
by MisterGuy420 · 2026-02-19
68.3%
#18907: Fix: Improve browser error messages to avoid misleading agents
by jriff · 2026-02-17
68.3%
#23668: fix: distinguish browser validation errors from connectivity failures
by davidemanuelDEV · 2026-02-22
68.2%
#8494: fix(test): resolve flaky port race condition in chutes-oauth.test.ts
by gavinbmoore · 2026-02-04
68.1%