Title: muse-proxy: MUSE_PROXY_PORT parsed with bare parseInt — the one bin proxy that skips the strict parseProxyPort helper (#483) · Issue #661 · developing-today/code · GitHub
Open Graph Title: muse-proxy: MUSE_PROXY_PORT parsed with bare parseInt — the one bin proxy that skips the strict parseProxyPort helper (#483) · Issue #661 · developing-today/code
X Title: muse-proxy: MUSE_PROXY_PORT parsed with bare parseInt — the one bin proxy that skips the strict parseProxyPort helper (#483) · Issue #661 · developing-today/code
Description: Finding bin/muse-proxy.mjs:26 is the only proxy in bin/ that does not parse its listen port through the shared strict helper: const PORT = parseInt(process.env.MUSE_PROXY_PORT || '18747', 10); Every sibling uses parseProxyPort from bin/p...
Open Graph Description: Finding bin/muse-proxy.mjs:26 is the only proxy in bin/ that does not parse its listen port through the shared strict helper: const PORT = parseInt(process.env.MUSE_PROXY_PORT || '18747', 10); Ever...
X Description: Finding bin/muse-proxy.mjs:26 is the only proxy in bin/ that does not parse its listen port through the shared strict helper: const PORT = parseInt(process.env.MUSE_PROXY_PORT || '18747', 1...
Opengraph URL: https://github.com/developing-today/code/issues/661
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"muse-proxy: MUSE_PROXY_PORT parsed with bare parseInt — the one bin proxy that skips the strict parseProxyPort helper (#483)","articleBody":"## Finding\n\n`bin/muse-proxy.mjs:26` is the only proxy in `bin/` that does not parse its listen port through the shared strict helper:\n\n```js\nconst PORT = parseInt(process.env.MUSE_PROXY_PORT || '18747', 10);\n```\n\nEvery sibling uses `parseProxyPort` from `bin/proxy-port.mjs` — codex-proxy.mjs:10, clef-proxy.mjs:8, agy-proxy.mjs:10, antigravity-ls-proxy.mjs:10, design-code-proxy.mjs:6/:9/:10 (7 sites). The helper's header (proxy-port.mjs:1-8, from #483) states the rule and the exact failure modes a bare `parseInt` causes:\n\n> A bare parseInt is not a validator: 'abc' becomes NaN (an opaque ERR_SOCKET_BAD_PORT crash at listen time), '18744abc' and '18744.9' silently become 18744, and '0x4a38' becomes 0, which binds a random ephemeral port while every client keeps dialling the configured one. Every proxy parses its *_PROXY_PORT through here instead, so a bad value fails at startup with the env var and its value named.\n\nmuse-proxy was added after that rule (it mirrors codex-proxy per its header comment) and never adopted the helper — and the guard that should have caught it doesn't see it: `bin/proxy-port.test.mjs`'s test \"all seven parse sites in the five proxies use the shared helper\" enumerates only the five older proxies, so muse-proxy is in neither its import/`parseInt` checks nor the site count.\n\n## Verified on current main (f1a8abf0)\n\nLive repro, `MUSE_PROXY_PORT=\u003cvalue> node bin/muse-proxy.mjs`:\n\n- `18747abc` → silently binds 18747 (trailing junk ignored; `parseProxyPortValue` rejects this spelling)\n- `99999` → crashes with an unhandled `RangeError [ERR_SOCKET_BAD_PORT]` stack from `node:net`, naming neither the env var nor its value\n- `abc` → same opaque crash (`Received type number (NaN)`)\n- `0x4a38` → binds port **0** — a random ephemeral port — and logs `listening on http://127.0.0.1:0`, while clients keep dialling 18747\n\nWith the helper, each of these exits 1 at startup with `MUSE_PROXY_PORT=\"\u003cvalue>\" is not a valid port (expected an integer 1-65535)`.\n\n## Why it matters\n\nThis is the exact silent-misconfiguration class #483/#494 fixed for the other five proxies: a typo'd `MUSE_PROXY_PORT` in a service environment either crashes opaquely or — worse, for `0x…`/0 spellings — starts \"successfully\" on a random port while every configured client dials the dead one. The proxy family is meant to be uniform here; one member quietly opting out is how the bug class comes back.\n\n## Acceptance criteria\n\n- `bin/muse-proxy.mjs` imports `parseProxyPort` from `./proxy-port.mjs` and parses its port as `parseProxyPort('MUSE_PROXY_PORT', 18747)`; no bare `parseInt(process.env.…PROXY_PORT…)` remains in the file.\n- Bad spellings (`abc`, `99999`, `18747abc`, `18747.9`, `0x4a38`, `0`, `-1`) exit 1 at startup with the error naming `MUSE_PROXY_PORT` and the offending value; unset/empty still defaults to 18747 and a valid value binds exactly that port (existing `bin/muse-proxy.test.mjs` suite stays green).\n- The guard test in `bin/proxy-port.test.mjs` covers muse-proxy: it joins the enumerated proxy list (import + no-bare-parseInt assertions) and the parse-site count goes from seven to eight. If muse-proxy is not launched from `home/common/default.nix` the way the other five are, the home-manager test's file list should be evaluated separately rather than silently extended.\n- Cross-repo: muse-proxy exists only in this repo (no `MUSE_PROXY_PORT`/`muse-proxy` copy in developing-today/opencode, developing-today/openchamber, or dezren39/nix — grep-verified at filing), so this is a single-repo fix, not a cross-repo set.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-23T09:40:05Z","url":"https://github.com/developing-today/code/issues/661"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1ea8a907-d8f3-8485-af5f-33135a5e06b7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CD58:2356C0:93DBF8:C500DE:6B06396F |
| html-safe-nonce | eecbfe4dce8fe92968895dc6d4ab0f8f4236057e9d4b8e204ec0a704463ba4d2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRDU4OjIzNTZDMDo5M0RCRjg6QzUwMERFOjZCMDYzOTZGIiwidmlzaXRvcl9pZCI6IjE4NDM0MzQwMjQzMjk0MjczMTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 151ad2fd25a7d9d394b57a15912362500c055e007df448cec80a2e0756a6a0bd |
| hovercard-subject-tag | issue:5995486156 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/661/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0ad08ca0d8d696c0ba54d8d3d8e1c073cae5f3948efbd20588a7e08a7da6f98a/developing-today/code/issues/661 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0ad08ca0d8d696c0ba54d8d3d8e1c073cae5f3948efbd20588a7e08a7da6f98a/developing-today/code/issues/661 |
| og:image:alt | Finding bin/muse-proxy.mjs:26 is the only proxy in bin/ that does not parse its listen port through the shared strict helper: const PORT = parseInt(process.env.MUSE_PROXY_PORT || '18747', 10); Ever... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | dcf72c457c022486d23c3cbb0dd21aba537a87611ca9ddabd1799cf2eaa9b297 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 0f38f5735226749ec5e08a8649dce4cb2613d9ad |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width