Title: codex-proxy: PR #431's {env:CODEX_PROXY_PORT} baseURL has no fallback — opencode outside a home-manager shell gets an empty port · Issue #434 · developing-today/code · GitHub
Open Graph Title: codex-proxy: PR #431's {env:CODEX_PROXY_PORT} baseURL has no fallback — opencode outside a home-manager shell gets an empty port · Issue #434 · developing-today/code
X Title: codex-proxy: PR #431's {env:CODEX_PROXY_PORT} baseURL has no fallback — opencode outside a home-manager shell gets an empty port · Issue #434 · developing-today/code
Description: Finding PR #431 single-sources the codex-proxy port by changing the openai-codex provider's baseURL in .opencode/opencode.jsonc from the hardcoded http://127.0.0.1:18744/v1 to http://127.0.0.1:{env:CODEX_PROXY_PORT}/v1. The only place th...
Open Graph Description: Finding PR #431 single-sources the codex-proxy port by changing the openai-codex provider's baseURL in .opencode/opencode.jsonc from the hardcoded http://127.0.0.1:18744/v1 to http://127.0.0.1:{env...
X Description: Finding PR #431 single-sources the codex-proxy port by changing the openai-codex provider's baseURL in .opencode/opencode.jsonc from the hardcoded http://127.0.0.1:18744/v1 to http://127.0.0.1:...
Opengraph URL: https://github.com/developing-today/code/issues/434
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"codex-proxy: PR #431's {env:CODEX_PROXY_PORT} baseURL has no fallback — opencode outside a home-manager shell gets an empty port","articleBody":"## Finding\n\nPR #431 single-sources the codex-proxy port by changing the `openai-codex` provider's baseURL in `.opencode/opencode.jsonc` from the hardcoded `http://127.0.0.1:18744/v1` to `http://127.0.0.1:{env:CODEX_PROXY_PORT}/v1`. The only place the new variable is set is `home.sessionVariables` (`home/common/default.nix`, from the single `codexProxyPort` definition) — i.e. it exists only in processes that inherit a home-manager shell session's environment.\n\nOpenCode's `{env:VAR}` substitution has **no fallback**: a missing variable substitutes the empty string. In developing-today/opencode, `packages/core/src/config/variable.ts` (substitute function): `const value = (input.env?.[name] ?? process.env[name]) || \"\"`. So any opencode process launched without `CODEX_PROXY_PORT` in its environment gets baseURL `http://127.0.0.1:/v1` — a dead provider, and exactly the \"looks like a network/auth problem\" failure mode PR #431 set out to eliminate. The proxy script itself keeps a fallback (`bin/codex-proxy.mjs:7`: `process.env.CODEX_PROXY_PORT || '18744'`); after this PR the client side no longer has one, so the two sides can now disagree in the opposite direction: proxy listening on 18744, client dialling port \"\".\n\n## Evidence\n\n- PR #431 (OPEN, head `5be5217f`): `.opencode/opencode.jsonc` baseURL becomes `http://127.0.0.1:{env:CODEX_PROXY_PORT}/v1`; `home/common/default.nix` sets `CODEX_PROXY_PORT = toString codexProxyPort;` only under `home.sessionVariables`.\n- PR #431's verification only covers the variable-set case: \"a test server with `CODEX_PROXY_PORT=18744` in its environment resolved the provider from the substituted config correctly.\" The unset case is untested.\n- Concrete unset launch path, verified today: the Muse sandbox's `opencode serve` runs as a systemd service whose environment file (`~/tools/secrets.d/opencode-serve.env`) sets the proxy/CA/Cloudflare keys and the PR #430 feature flags but **not** `CODEX_PROXY_PORT` (key list checked 2026-10-20), while its deployed config is this repo's `.opencode/opencode.jsonc`. Merging #431 as-is turns that server's codex provider from \"works when the proxy runs\" into \"empty port, always dead\". Desktop/VS Code launches and other service contexts have the same exposure wherever they don't source the shell session variables.\n\n## Why it matters\n\nThe hardcoded port worked in *every* launch context; the env-substituted one silently works only in shell-launched ones. This reintroduces the PR's own failure mode (silently dead provider, misleading error) for a different — and already existing — class of launches.\n\n## Acceptance criteria\n\n- With `CODEX_PROXY_PORT` unset, the `openai-codex` provider's resolved baseURL still points at the proxy's fallback port (18744), OR every supported way of launching opencode with this config (shell, systemd service, desktop/VS Code) demonstrably receives the variable, with the sandbox `opencode-serve` service as the worked example.\n- A check or test pins the unset-variable behaviour so it can't regress silently (e.g. rendering/validating the effective config with the variable unset).\n- The solution keeps PR #431's single-source property: one definition of the port that all consumers derive from.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-20T19:09:50Z","url":"https://github.com/developing-today/code/issues/434"}
| 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:001e8dc7-6948-451b-c310-bae4eb3e84dc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A3E4:DAF5F:705B91:916425:6B062670 |
| html-safe-nonce | 4068440fb1bf9314efd1d82ee4899b46d7b3b8e39a2868dda33103e89aa51d66 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBM0U0OkRBRjVGOjcwNUI5MTo5MTY0MjU6NkIwNjI2NzAiLCJ2aXNpdG9yX2lkIjoiNjU4ODkzNjE5MTMxNDYzNDM1MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | db88e74bb3e86e147849a4f8b9d4015012e14debdd97ca5119c6949213389eab |
| hovercard-subject-tag | issue:5947897875 |
| 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/434/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7bc677c4e7756f7a10353f8bbf003c987cdb81816398957a6600ea94ca017718/developing-today/code/issues/434 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7bc677c4e7756f7a10353f8bbf003c987cdb81816398957a6600ea94ca017718/developing-today/code/issues/434 |
| og:image:alt | Finding PR #431 single-sources the codex-proxy port by changing the openai-codex provider's baseURL in .opencode/opencode.jsonc from the hardcoded http://127.0.0.1:18744/v1 to http://127.0.0.1:{env... |
| 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 | 9e10bb0ecc0bd0f8692aa89586ee9b54e498d7ab9f244a44cdb5b93653a125ce |
| 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 | 32e57d5cc2ce6ce92ec6dceb65858344750c27c2 |
| ui-target | full |
| 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