openai / openai/codex

macOS: cua_repl does not respawn after launch.mjs/node_repl exit; createBrowserTab returns Transport closed in ~1ms

Open
#44,518 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app-server browser bug CLI computer-use connectivity mcp
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

What version of Codex CLI is running?

codex-cli 0.153.4 (codex app-server --enable goals)

Computer Use runtime comes from ChatGPT.app 26.903.61454 (build 8378) via plugin unified-computer-use@openai-bundled (launch.mjs + bundled cua_node / node_repl). Hosts observed: 26.901.51231 and 26.903.61454.

What subscription do you have?

Logged in with ChatGPT. Exact plan not exposed by this CLI/app-server path.

Which model were you using?

Not model-dependent. Reproduced on gpt-5.6-luna because that is the long-lived thread; the failures are MCP transport / Computer Use host lifecycle.

What platform is your computer?

Darwin 25.6.0 arm64 arm (macOS 26.6.2, 25G83)

What terminal emulator and version are you using (if applicable)?

Not a TUI session. codex app-server --enable goals spawned by Paseo Desktop 0.8.0-beta.1 (bundle sh.paseo.desktop). Same plugin/cua_repl stack as Codex Computer Use.

Codex doctor report

not available (not run; this is a Computer Use MCP transport failure on a long-lived app-server)

What issue are you seeing?

Two related Computer Use failures on a long-lived app-server that we did not restart.

A. Chrome CUA works, then getState() reports no browsers while the Chrome native host is still alive.

cua.createBrowserTab("chrome", url, { sessionName }) plus Playwright waitForEvent("filechooser") + setFiles succeeded (2026-09-10 ~17:37–17:48 local, and createBrowserTab("chrome", …) again ~18:39).

Later the same process’s cua.getState() returned:

apps=[]
browsers=[]
Sky Computer Use native pipe startup failed

At that time:

  • Google Chrome was still running
  • native host ChatGPT for Chrome (chrome-extension://hehggadaopoacecdllhhajmbjkdcmajg/) was still a child of Chrome
  • js_reset did not restore browsers

Plugin env:

CUA_REPL_ENABLED_SURFACES=browser,computer

Sky Apple Events were already failing for the responsible parent app. A Sky native-pipe failure appears to zero both surfaces.

B. After launch.mjs / node_repl exit, cua_repl never respawns. Every subsequent call is Transport closed in milliseconds.

The app-server stayed up (writer lock still held). Its children no longer included launch.mjs / node_repl. Next calls:

tool call error: tool call failed for `cua_repl/js_reset`

Caused by:
    Transport closed
tool call error: tool call failed for `cua_repl/js`

Caused by:
    Transport closed

Exact MCP item for the last createBrowserTab (URL/session name redacted):

server: cua_repl
tool: js
status: failed
error.message: tool call error: tool call failed for `cua_repl/js`

Caused by:
    Transport closed
duration: { "secs": 0, "nanos": 1408875 }

Wall time printed by the tool wrapper: 0.0046 seconds.

Quitting ChatGPT.app and retrying the same createBrowserTab("chrome", …) (no getState, no js_reset) still returned Transport closed in ~1.4ms. No new CUA host appeared under the app-server. Another app-server on the same machine still had a live 26.903.61454 launch.mjs child, so Computer Use is not globally dead — only this session’s MCP stdio.

What steps can reproduce the bug?

The empty-browsers state is intermittent. The Transport closed / no-respawn path is reproducible once the bound host is gone.

  1. Keep a Codex app-server alive for many hours with unified-computer-use / cua_repl attached (do not start a new thread).

  2. Confirm Chrome CUA works:

    let tab = await cua.createBrowserTab("chrome", "https://example.com", { sessionName: "repro" });
    tab
    
  3. Leave the session running. Optionally quit/relaunch ChatGPT.app, or let Sky native pipe fail. Call cua.getState(). Observe browsers=[] and Sky Computer Use native pipe startup failed even if the Chrome extension native host is still running.

  4. Kill or wait until this thread’s …/unified-computer-use/*/scripts/launch.mjs and its node_repl children exit. Do not kill the app-server.

  5. Call js_reset and/or cua.createBrowserTab("chrome", …) again.

Expected: Codex starts a new launch.mjs host for cua_repl, or surfaces an actionable “Computer Use host died, restart MCP” error.

Actual: Transport closed in ~1ms. pgrep -P <app-server-pid> still has no CUA child. js_reset cannot recover a dead stdio transport. Starting a different app-server can still get a fresh host.

What is the expected behavior?
  • getState() / createBrowserTab("chrome") should not depend on Sky native pipe when the Chrome native host is alive. If CUA_REPL_ENABLED_SURFACES includes browser, a computer handshake failure should not report browsers=[].
  • If launch.mjs / node_repl exits, app-server should respawn cua_repl on the next tool call (or clearly mark the MCP server as dead and restart it). js_reset should not be the only recovery, and it should not be offered when the transport is already closed.
  • Long-lived sessions should not require killing app-server (and losing the thread writer lock) to get Computer Use back.
Additional information

Related:

  • openai/codex#39042 — pre-update node_repl cannot authenticate; js_reset insufficient; fresh host works. Same recovery hole for a live app-server.
  • openai/codex#25744 / #39816 — node_repl helper accumulation.
  • openai/codex#25848 — intermittent transport closed (Windows app).
  • openai/codex#35234 — native pipe sender not authenticated.
  • openai/codex#43498 — CUA_REPL_ENABLED_SURFACES=browser stripping Sky (inverse coupling).
  • getpaseo/paseo#3346 — Paseo Desktop lacks com.apple.security.automation.apple-events, so macOS attributes Paseo-spawned Sky CUA to Paseo and denies Apple Events without a prompt. That explains Sky, not Chrome CUA working then dying, and not Transport closed after host exit.

.mcp.json for cua_repl (paths redacted to usernames):

command: /Applications/ChatGPT.app/Contents/Resources/cua_node/bin/node
args: [ "~/.codex/plugins/cache/openai-bundled/unified-computer-use/26.903.61454/scripts/launch.mjs" ]
env.CUA_REPL_ENABLED_SURFACES: browser,computer
env.CUA_REPL_NODE_REPL_PATH: /Applications/ChatGPT.app/Contents/Resources/cua_node/bin/node_repl
startup_timeout_sec: 120
tools: js, js_reset, turn_ended

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the app-server MCP process lifecycle and the cua_repl command that launches launch.mjs with node_repl. Reproduce the failure by allowing those children to exit, then inspect how js_reset and the next js or createBrowserTab call handle the closed transport. Done means the session respawns cua_repl or reports an actionable dead-server state without requiring a new app-server.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, rust
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.