[macOS][26.831.21537] cua_repl trusted worker drops NODE_REPL_TRUSTED_SERVICES and crashes before browser attachment
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
What version of the Codex App are you using?
26.831.21537, build 7579
What subscription do you have?
Business
What platform is your computer?
Darwin 25.6.0 arm64 arm
What issue are you seeing?
The in-app Browser cannot attach to an open tab because the trusted JavaScript worker exits before browser discovery.
Every cua_repl call fails immediately with:
trusted Node process exited unexpectedly; kernel reset, rerun your request
The Desktop logs show the underlying exception:
SyntaxError: "undefined" is not valid JSON
at JSON.parse (<anonymous>)
at Object.<anonymous> (.../trusted-worker.js:19:33)
Line 19 is:
const configuredServices = JSON.parse(process.env.NODE_REPL_TRUSTED_SERVICES);
~/.codex/config.toml contains a valid NODE_REPL_TRUSTED_SERVICES JSON value, and codex mcp get node_repl --json reports that value in the effective transport configuration. The managed trusted worker still receives undefined.
This fails before any target URL, browser tab, or site authentication is involved. The in-app Browser can be visibly open and loaded while the control worker continues to crash.
What steps can reproduce the bug?
-
Open an in-app Browser tab in Codex Desktop.
-
Start a local Codex task and ask it to use the in-app Browser.
-
Run the documented first connection call, or the minimal state call:
await cua.getState(); -
The trusted process exits immediately.
-
Reset the JavaScript kernel and retry a trivial call with no browser access. The same process exit occurs.
-
Fully restart Codex Desktop and retry. The failure remains.
The Browser worked earlier on the same machine before updating to this build.
What is the expected behavior?
The trusted worker should inherit the configured trusted services, stay running, and attach to the open in-app Browser tab.
If the variable is genuinely missing, the launcher should return a clear configuration error instead of crashing on JSON.parse(undefined).
Additional information
This looks like an environment-propagation regression between the app-managed MCP configuration and the trusted worker process. It is not a target-site failure.
Related reports:
- #39591
- #42238
- #42485
- #42454
Those reports cover adjacent initialization, trusted-RPC, and generated-runtime failures. This report captures the narrower invariant: the effective config contains NODE_REPL_TRUSTED_SERVICES, but the managed trusted worker does not inherit it.
No local app bundle or sandbox workaround is installed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with trusted-worker.js line 19 and reproduce the failure using the documented cua.getState() call after checking codex mcp get node_repl --json. Trace how NODE_REPL_TRUSTED_SERVICES moves from ~/.codex/config.toml into the managed trusted worker. Done means the worker remains running with the configured services and reports a clear configuration error when the variable is absent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- desktop, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100