← Back to PRs

#18549: Fix: align DEFAULT_BROWSER_CONTROL_PORT with base+2 derivation logic …

by reza6ix open 2026-02-16 20:38 View on GitHub →
stale size: XS
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